Mk: generate SBOM .pc files for all ports
Each package and subpackage now installs an SBOM file in pkg-config
format, see pc(5). The file is installed in ${PREFIX}/share/sbom/pc/.
The framework adds it to the plist automatically.
PR: 300098
Differential Revision: https://reviews.freebsd.org/D60441
Mk/bsd.sites.mk: Add USE_FORGEJO helper
When a distribution file is to be fetched from a specific commit or tag
on a Forgejo or Gitea site, USE_FORGEJO provides helper variables to
automatically set key variables such as DISTNAME and MASTER_SITES to the
correct values. It is modelled after USE_GITHUB and USE_GITLAB.
Reviewed by: diizzy, fuz, siva
Approved by: portmgrg (bapt)
Sponsored by: The FreeBSD Foundation
Pull Request: https://ron-dev.freebsd.org/FreeBSD/ports/pulls/9
Templates/config.(guess|sub): Update to 2026-05-17
Also remove our local changes that replaced x86_64 with amd64 because
these complicate porting by forcing port maintainers to replace x86_64
with amd64 in configure scripts.
Additional changes:
bsd.port.mk: Apply S/amd64/x86_64/ to CONFIGURE_TARGET. This is not
required to run configure but some ports need to use this in pkg-plist.
comms/qico, news/fidogate:
CONFIGURE_TARGET shouldn't contain "--build". Just remove it altogether
because the default value is fine.
devel/autoconf, devel/automake:
Bump PORTREVISION because they package config.* scripts.
lang/gauche, math/fricas, math/gap, math/nlopt, math/octave, net/pjsip:
Bump PORTREVISION because pkg-plist depends on CONFIGURE_TARGET.
benchmarks/pathchirp, databases/sqlrelay, devel/pcc-libs, lang/ocaml,
lang/pcc, math/adol-c, math/scilab, math/yices, multimedia/libtheora,
multimedia/libxine, security/beecrypt, sysutils/ltrace,
sysutils/pstacku, textproc/gnugrep:
Add, remove, or change patching related to x86_64 versus amd64.
audio/festalon:
Configuring with x86_64 instead of amd64 enables some MMX code that
isn't entirely correct. Patch it based on the i386 code. While here,
enable building the i386 package.
lang/pfe:
Configuring with x86_64 instead of amd64 enables the use of global
register variables but these are a GCC extension that Clang does not
support. Add --without-regs to disable them. This also fixes the i386
build.
editors/openoffice-*:
The build system runs config.guess and the newer version returns i586
for i386. Let build scripts treat i[3456]86 like i386 as on Linux.
math/reduce-psl:
The build system uses the output of config.guess to create directories
but this script might return something like i586-unknown-freebsd14.5
while the ports tree uses i386-portbld-freebsd14.5. Instead of running
config.guess plug in the value of CONFIGURE_TARGET. The proper fix
would be to let the configure script generate the build scripts so they
can use $host from the configure script but that's more work.
PR: 299273
Exp-run by: antoine
Mk/bsd.port.mk: revert fix cross compilation of kmods
This reverts commit 65fdabc9b93f0fef6cffe5eaca30d646286e0edb.
This has unexpected side effect and should have been done via an exp-run
Mk: Drop test dependencies from the unified dependency list
TEST_DEPENDS_ALL was part of _UNIFIED_DEPENDS, so test-only
dependencies leaked into all-depends-list, missing,
clean-depends, fetch-recursive, deinstall-depends and the QA
checks, even though they are not needed to build, package or
install a port. It pollutes all the convenience -recursive targets
including poudriere options.
They are still installed by "make test" through the test-depends
target, which is now documented as well.
The motivation for this patch is the fact that many ports now
end up having chromium as part of their dependency list following
the new dependency needed to upgrade py-great-table
(15ce974d8e0560b8038db69598cdf68c52273e68)
Reviewed by: mat@ (portmgr)
Reported by: wollman (portmgr)
Differential Revision: https://reviews.freebsd.org/D60032
Mk: add a BUILD_RUN_DEPENDS variable
Add BUILD_RUN_DEPENDS as a syntastic sugar for adding dependencies to
both BUILD_DEPENDS and RUN_DEPENDS without side effects.
Differential Revision: https://reviews.freebsd.org/D59664
Mk/bsd.port.mk: Drop the strip parameter from PATCHFILES passed to do-fetch.sh
After recent changes to handling of do-fetch.sh in bsd.port.mk, the
strip parameters (e.g., ":-p1") are no longer dropped before do-fetch.sh
receives patch files.
As a result, a strip parameter of a patch file might be interpreted as a
group instead and get prepended to the patch file, resulting in warnings
like:
```
$ make makesum
===> License MIT accepted by the user
=> e3efbb5923f638b38087a3f616906d9d4fdaf6f2.patch doesn't seem to exist in
/var/cache/distfiles.
=> Attempting to fetch p1e3efbb5923f638b38087a3f616906d9d4fdaf6f2.patch
fetch: p1e3efbb5923f638b38087a3f616906d9d4fdaf6f2.patch: No such file or
directory
```
Reviewed by: mat
Approved by: portmgr (mat)
Fixes: 076687302bff Mk: fix checksum/fetch/makesum with large distfiles set
Sponsored by: fme AG
Differential Revision: https://reviews.freebsd.org/D59811
Mk: fix checksum/fetch/makesum with large distfiles set
When a port has a very large set of DISTFILES, makesum/fetch dies with
an obscure message such as:
> /tmp/makeQEBorT: /usr/bin/env: Argument list too long
The interface from make(1) to sh(1) passes the list of MASTER_SITES and
DISTFILES as arguments on the command line. At one point, it reaches
ARG_MAX and fails with the previous message. This changes the interface
to use temporary files in WRKDIR.
PR: 295029
Differential Revision: https://reviews.freebsd.org/D59475
ldconfig: Revert "ldconfig: Add rootdir support and handle INSTALL_AS_USER"
Something was not properly catched by the exp-run, revert until
I fix the fallouts
Mk/bsd.port.mk: fix install-missing-packages without a tty
install-missing-packages runs xargs with -o, which reopens stdin from
/dev/tty so that pkg can prompt interactively. In automated or batch
runs there is no controlling terminal, so xargs fails with "can't open
/dev/tty: Device not configured".
Make the -o flag conditional on BATCH: keep the interactive pkg prompt
outside BATCH, and use pkg install -yA (auto-confirm) inside BATCH.
PR: 267416
Reported by: patmaddox@FreeBSD.org
Mk/bsd.port.mk: mark 14.3 unsupported
all: drop supoprt for FreeBSD 14.3
While here clean up some leftovers from FreeBSD 13
Reviewed by: adamw, jbeich, kirill_varnakov.com, saheed, sunpoet
Approved by: portmgr (implicit)
Differential Revision: https://reviews.freebsd.org/D57282
*/*: Use C.UTF-8 locale
Ports 02f27a83b44d fixed the ports tree to the C locale so it would work
correctly in environments where users use a locale that isn't compatible
with the C locale, e.g. xx_YY.UTF-8 where [A-Z] includes more than just
upper case letters. USE_LOCALE was introduced to let ports use another
locale if they needed it. The C.UTF-8 locale was created later on to be
mostly compatible with the C locale.
Switch the ports tree locale to C.UTF-8 and remove USE_LOCALE. The
world has moved to Unicode so all ports either require it or know how to
build correctly in a Unicode environment.
PR: 295945
Exp-run by: antoine
Mk/bsd.port.mk: Use SETENV for EXTRACT_ENV
Follow the precedent set by the other *_ENV variables in the ports
framework. The only practical effect is a very slight slowdown.
Fixes: 98103f194302 ("Mk/bsd.port.mk: Add EXTRACT_ENV")
Requested by: arrowd
MFH: 2026Q2
Reviewed by: mat
Differential Revision: https://reviews.freebsd.org/D57302
Mk/bsd.port.mk: Add EXTRACT_ENV
Add an EXTRACT_ENV variable which defaults to LC_ALL=C.UTF-8. We set
LC_ALL=C globally to ensure our scripts work the way we intend them to,
but this causes tar and unzip to fail to extract distfiles containing
names that cannot be expressed in ASCII. This was previously masked by
a bug in libarchive which caused tar and unzip to fail to notice that
these names were unconvertible and just pass them through unchanged.
MFH: 2026Q2
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D57295
bsd.port.mk: also export GNU strip when USE_BINUTILS is set
GNU Binutils packages strip, and should be used in preference to the base
LLVM strip when USE_BINUTILS = yes.
Do not take over the STRIP makefile variable, which is already used in
bsd.port.mk to signal whether the install program should strip the
binaries. Instead define STRIP_CMD and use STRIP just for the environment
variables.
Reviewed by: dim arrowd
Approved by: mat (portmgr)
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D55509
*/*: remove checks that base ld is(n't) GNU ld
GNU binutils was removed entierly prior to 13.0 so assume /usr/bin/ld
is LLD.
Sponsored by: DARPA, AFRL
Reviewed by: arrowd, bapt
Approved by: portmgr (bapt)
Differential Revision: https://reviews.freebsd.org/D55691
Mk: Add QA for common directories that are excluded in modern setuptools.
Directories like docs/ should not be installed to site-packages because they
are not useful when installed there and tend to cause conflicts with other
packages. This follows similar guidelines for Debian, Fedora and other major
Linux distributions.
PR: ports/290944
Approved by: portmgr (mat)
Mk/bsd.port.mk: Allow DIST_SUBDIR to be defined, but empty
The rationale for this change is to allow ports to cancel out
DIST_SUBDIR that is set by some USES. For example, `Uses/linux.mk` has
`DIST_SUBDIR?= rocky` and we want to be able to opt-out of this in the port.
Approved by: bapt (portmgr)
Differential Revision: https://reviews.freebsd.org/D53028
bsd.port.mk: Make WITHOUT_CPU_CFLAGS also work for CXXFLAGS
In base 0fb33e049ac0 the _CPUFLAGS value (initialized from CPUTYPE in
make.conf) is also being appended to CXXFLAGS, instead of only to
CFLAGS.
Some ports use WITHOUT_CPU_CFLAGS to avoid having CPUTYPE flags added to
their command lines, for example devel/wasi-libcxx*.
bsd.port.mk handles it like so:
. if defined(WITHOUT_CPU_CFLAGS)
. if defined(_CPUCFLAGS)
. if !empty(_CPUCFLAGS)
CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//}
. endif
. endif
. endif
However this will no longer work after base 0fb33e049ac0 (which is in
main and stable/15), leading to build errors similar to:
FAILED: [code=1]
libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_aux_runtime.cpp.o
/usr/local/llvm19/bin/clang++ --target=wasm32-wasi
--sysroot=/usr/local/share/wasi-sysroot -DLIBCXXABI_SILENT_TERMINATE
-DLIBCXX_BUILDING_LIBCXXABI -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
-D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_HAS_NO_THREADS
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-I/wrkdirs/usr/ports/devel/wasi-libcxx19/work/llvm-project-19.1.7.src/libcxxabi/../libcxx/src
-I/wrkdirs/usr/ports/devel/wasi-libcxx19/work/.build/include/c++/v1
-I/wrkdirs/usr/ports/devel/wasi-libcxx19/work/llvm-project-19.1.7.src/libcxxabi/include
-O2 -pipe -fno-strict-aliasing -march=haswell -Werror=date-time
-Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough
-Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor
-Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color
-ffunction-sections -fdata-sections -O2 -pipe -fno-strict-aliasing
-march=haswell -DNDEBUG -std=c++23 -D_DEBUG -UNDEBUG -MD -MT
libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_aux_runtime.cpp.o -MF
libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_aux_runtime.cpp.o.d -o
libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_aux_runtime.cpp.o -c
/wrkdirs/usr/ports/devel/wasi-libcxx19/work/llvm-project-19.1.7.src/libcxxabi/src/cxa_aux_runtime.cpp
clang++: error: unsupported option '-march=' for target 'wasm32-wasi'
Fix this by using the same logic for CXXFLAGS as for CFLAGS.
PR: 289844, 289673
Approved by: portmgr timeout (2 weeks)
MFH: 2025Q4
bsd.port.mk: Spell .export-env correctly
Fixes: c0363d749119 ("First bit of support to cross build the ports tree will
only work")
Reviewed by: ivy
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52895
Mk/bsd.port.mk: remove developer recommendations to apply pathfix
The framework is already dealing with making sure the .pc files in
lib/pkgconfig are moved to libdata/pkgconfig since 2017
The other location where .pc files can be installed (share/pkgconfig)
is valid since 2022, so pathfix to deal with .pc files is now useless.
Reviewed by: mat (over matrix)
Differential Revision: https://reviews.freebsd.org/D51476
Mk/bsd.port.mk: Remove confusing double "/" from _DISTDIR
_DISTDIR is a variable which stores the distfiles directory of the port
that is currently being worked on. In practice, it is usually just
the DISTDIR, although some ports also define a subdirectory. Currently,
a slash separating DISTDIR from DIST_SUBDIR is added to _DISTDIR
no matter if DIST_SUBDIR is set or not. This may cause confusion to
ports users by looking like a bug while it is not.
In particular, this patch casuses diagnostic logs of failed archive
extraction to look like this:
===> Failed to extract "/portdistfiles/ttf-iosevka-ss05-4.1.1.zip".
Instead of this:
===> Failed to extract "/portdistfiles//ttf-iosevka-ss05-4.1.1.zip".
PR: 282291
Reviewed by: pizzamig
Approved by: pizzamig (portmgr)
Event: Berlin Hackathon 202507
Differential Revision: https://reviews.freebsd.org/D27722
Mk/bsd.port.mk: Remove compatibility with pkg pre 1.17
in pkg 1.17 the extension was changed to always be .pkg, all supported
version of FreeBSD and bootstrap now support .pkg, it is time to remove
backware compatibility
Approved by: mat (portmgr) on matrix
Differential Revision: https://reviews.freebsd.org/D51142
Mk/bsd.port.mk: mark FreeBSD 13.4 as unsupported.
Drop support for FreeBSD 13.4 (and sometimes 12, 14.0, 14.1) from all
ports.
Reviewed by: dch, @gor_clogic.com.ua
Approved by: portmgr (implicit)
Differential Revision: https://reviews.freebsd.org/D50769
Mk/bsd.port.mk: Allow package not to expose some of their libraries
2 new KNOB: NO_SHLIB_PROVIDES_GLOB and NO_SHLIB_PROVIDES_REGEX which
allow to define glob and regex patterns of libraries which should not be
automatically exposed by packages via shlibs provides and requires
Mk/Features: Add features for fortify, zeroregs and stack autoinit.
Those 3 features for ports go along with the cooresponding features from
the basesystem (some only availabe in -current).
The options you can put into make.conf for the ports collections are:
WITH_FORTIFY=yes
This enables mitigations of common memory safety issues, such as buffer
overflows, by adding checks to functions like memcpy, strcpy, sprintf,
and others when the compiler can determine the size of the destination
buffer at compile time.
WITH_STACK_AUTOINIT=yes
This enables a compiler specific option to automatically initialize
local (automatic) variables to prevent the use of uninitialized memory.
WITH_ZEROREGS=yes
Zero call-used registers at function return to increase program
security by either mitigating Return-Oriented Programming (ROP)
attacks or preventing information leakage through registers.
This depends upon support from the compiler for a given architecture.
This is disabled for python ports, currently there are issues.
Approved by: portmgr (mat)
PR: 284270
Mk/bsd.port.mk: Pass CSTD/CXXSTD in MAKE_ENV
For ports which use bsd.*.mk in their build, the existing USE_CSTD
logic which patches CFLAGS and CXXFLAGS is insufficient since
bsd.sys.mk will add the default CSTD/CXXSTD later in CFLAGS/CXXFLAGS.
Presumably no ports are using USE_CSTD with bsd.*.mk, but at least one
does use USE_CXXSTD with bsd.*.mk which will break when src starts
defining a default CXXSTD.
PR: 285141
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D49597
Mk: add a new HAS_SYMBOL_VERSION
When a port is tagged with this (should contain the list of libraries
with SYMBOL version) the ports tree will add an extra check that
the built library actually have symbols versions.
Mk/bsd.port.mk: consider USE_LDCONFIG32 for provides/requires
With newer pkg we need to also take in account USE_LDCONFIG32
in the path where we do provide lib32 libraries
Mk/bsd.port.mk: Setup SHLIB_PROVIDE_PATHS* vars for pkg
This changes picks a new pkg feature: https://github.com/freebsd/pkg/pull/2422
The idea behind the `.if ${LINUX_DEFAULT} ...` check comes from the Linux
ld.so(8) man page that says
> (5) In the default path /lib, and then /usr/lib. (On some 64-bit
> architectures, the default paths for 64-bit shared objects
> are /lib64, and then /usr/lib64.)
CentOS 7 and Rocky Linux 9 that we have in Ports install 32 bit libraries
into `/usr/lib` and 64 bit libraries into `/usr/lib64`. `/lib` and `/lib64` are
symlinks, so I omitted them.
Differential Revision: https://reviews.freebsd.org/D49136
Approved by: bapt
Framework: Allow setting the 'vital' flag from a port
Approved by: bapt
Differential Revision: https://reviews.freebsd.org/D48697
Sponsored by: Future Crew, LLC
Mk/**java.mk: Convert bsd.java.mk to USES
The following features have been added or changed:
- Instead of USE_JAVA use USES=java. This defaults to
USES=java:build,run if NO_BUILD is undefined. Else it defaults to
USES=java:run
- Instead of USE_ANT=yes use USES=java:ant which also implies
USES=java:build
- Instead of JAVA_BUILD=yes use USES=java:build. Does not imply run or
extract
- Instead of JAVA_EXTRACT=yes use USES=java:extract does not imply
build or run
- Instead of JAVA_RUN=yes use USES=java:run does not imply extract or
build
- Instead of USE_JAVA=<version> use USES=java and JAVA_VERSION=<version>
Approved by: mat (portmgr), glewis
Differential Revision: https://reviews.freebsd.org/D48201
Mk/**ocaml.mk: Convert remaining bsd.ocaml.mk to Uses/ocaml.mk
- Instead of USE_OCAML=yes use USES=ocaml. If empty USES=ocaml implies
build and run
- Instead of USE_OCAMLFIND_PLIST use USES=ocaml:findplist which also
implies USES=ocaml:findlib
- Instead of USE_OCAML_CAMLP4 use USES=ocaml:camlp4
- Instead of USE_OCAML_FINDLIB use USES=ocaml:findlib
- Instead of USE_OCAML_LDCONFIG use USES=ocaml:ldconfig
- Instead of USE_OCAML_WASH use USES=ocaml:wash
- Instead of NO_OCAML_BUILDDEPENDS use USES=ocaml:run
- Instead of NO_OCAML_RUNDDEPENDS use USES=ocaml:build
- Instead of USE_OCAML_TK use USES=ocaml:tk which actually implies
USES=ocaml:tkbuild and USES=ocaml:tkrun
- Instead of NO_OCAMLTK_BUILDDEPENDS use USES=ocaml:tkrun
- Instead of NO_OCAMLTK_RUNDEPENDS use USES=ocaml:tkbuild
- USES=ocaml:dune remains unchanged
- Prepare to add/remove keywords easily
Approved by: mat (portmgr)
Reviewed by: freebsd@dev.thsi.be
Differential Revision: https://reviews.freebsd.org/D48227
Mk/bsd.port.mk: Remove obsolete descriptions
Both USE_TEX and USE_OPENLDAP has been converted to USES=tex and
USES=ldap respectively
Approved by: portmgr (blanket)
Mk/bsd.port.mk: stop ports from finding the ports tree's git repository
When building from source, the ports tree is by default a parent
directory of WRKDIR. When ports try to use git to find the git commit
they are built from, they'll some times find the port's git repository
and produce bogus metadata. Set GIT_CEILING_DIRS in WRK_ENV to ensure
that git does not escape WRK_ENV trying to look for a git repository
that doesn't exist.
This doesn't affect Poudriere builds as for these, WRKDIR is by default
not a subdirectory of the ports tree, and neither is git installed in
builder jails unless explicitly needed. As a result, bugs of this kind
tend to go unnoticed by maintainers, but do affect source builders.
Approved by: portmgr (mat)
Exp-run by: antoine
PR: 283098
Differential Revision: https://reviews.freebsd.org/D47850
kmod: append osversion to the portversion
The version is now
kmodpackagename-<kmodpackageversion>.<osversion>_<revision>,<epoch>
This is necessary to make sure that the same packages built on a newer
version of FreeBSD on a given branch is considered as an upgrade of the
default provided one.
In the current model of support, all packages are built on the lowest
supported version of a given branch, which means right now all packages
are built on 14.1, this results as since 14.2 has been released and up
to the time 14.1 is EOLed we do not provide working binary packages for
kernel modules and related for 14.2.
With this we will be able to provide a dedicated repo built against 14.2
that will be usable by users and pkg upgrade will simply update to the
right version.
https://reviews.freebsd.org/D47997
filesystems: add new category for file systems and related utilities
The filesystems category houses file systems and file system utilities.
It is added mainly to turn the sysutils/fusefs-* pseudo-category into
a proper one, but is also useful for the sundry of other file systems
related ports found in the tree.
Ports that seem like they belong there are moved to the new category.
Two ports, sysutils/fusefs-funionfs and sysutils/fusefs-fusepak are
not moved as they currently don't fetch and don't have TIMESTAMP set
in their distinfo, but that is required to be able to push a rename
of the port by the pre-receive hook.
Approved by: portmgr (rene)
Reviewed by: mat
Pull Request: https://github.com/freebsd/freebsd-ports/pull/302
PR: 281988
Mk/bsd.port.mk: Add MACHINE_ARCH to WRK_ENV
make(1) has a built-in variable MACHINE_ARCH that defaults to the value
of sysctl hw.machine_arch. This is not correct when building packages
under qemu. In that case poudriere sets MACHINE_ARCH in its make.conf.
Since commit d7511b9d0074 make.conf is not picked up by make during
build so pass MACHINE_ARCH through the environment.
This affects building kmod ports under qemu.
This is a workaround for make not looking at UNAME_p when setting
MACHINE_ARCH. It does look at UNAME_m when setting MACHINE.
PR: 281674
Reported by: jrtc27
Exp-run by: antoine
Approved by: portmgr (antoine)
all: drop support for expired FreeBSD 14.0
Simplify expressions for FreeBSD 13.X
Reviewed by: many
Differential Revision: https://reviews.freebsd.org/D46601
bsd.port.mk: remove unused base system binutils support
GNU binutils 2.17.50 was removed from the base system (for all archs)
prior to FreeBSD 13.0. Remove ports support for base system ld.bfd.
Reviewed by: portmgr (mat)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46015
all: drop support for FreeBSD 13.2 which reached EOL today
Thanks again to jbeich for noticing various things I overlooked.
Reviewed by: acm, ashish, eduardo, ehaupt, eugen, jbeich, martymac, mat,
nobukata, sunpoet, tagattie, yuri, arrowd, kde
Differential Revision: https://reviews.freebsd.org/D45141
Mk/bsd.port.mk: Update comment about quoting do-fetch env vars
Reviewed by: portmgr (mat)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45607
framework: reintroduce the feature enabling code
For each feature (see in Mk/Features) users can now set these variables
in their make.conf. Using LTO as an example.
To enable globally:
WITH_LTO= yes
To disable globally (for example ssp is enabled by default):
WITHOUT_LTO= yes
To enable for a specific list of ports:
WITH_LTO_PORTS= lang/perl5.36
To disable for a specific list of ports:
WITHOUT_LTO_PORTS= lang/perl5.36
Differential Revision: https://reviews.freebsd.org/D44750
Mk/bsd.port.mk: Add __MAKE_CONF=${NONEXISTENT} to WRK_ENV
And remove it from individual ports. Use WRK_ENV in custom build
commands where necessary.
FreeBSD make(1) includes /usr/share/mk/sys.mk and that includes
/etc/make.conf if it exists. This happens when you run make in a port
directory but it also happens when the upstream build system uses make.
This commit disables make.conf inclusion in the latter case because
users can define variables like CFLAGS in make.conf that override ports
framework variables and this can cause problems that are difficult to
diagnose.
If there are any build customisations made through make.conf that stop
working because of this commit then they should be made available by the
ports tree through some mechanism, e.g. an option in a port.
Some ports were picking up variables from Poudriere make.conf and
required fixes:
- astro/wmspaceweather x11-clocks/wmcalclock: Add OPSYS to MAKE_ENV.
- games/zhlt: Add ARCH to MAKE_ENV.
- graphics/tachyon: Upstream ARCH is not ports tree ARCH.
Set ALL_TARGET=bsd so upstream ARCH is defined correctly.
Enable multi-threading support while here.
PR: 277455
Exp-run by: antoine
Mk/bsd.port.mk: remove LEGAL related variables
This is noop since the ports tree does nothing with the variables
anymore for a while
Reviewed by: mat
Differential Revision: https://reviews.freebsd.org/D44252
Mk/*: Build with a clean environment
Both our make and gmake use the MAKEFLAGS environment variable but the
values aren't compatible and the latest version of gmake complains about
that. To rule out that any environment variable can cause problems like
this, add a new command SETENVI=/usr/bin/env -i that clears the
environment, and use it to run upstream build systems with a clean
environment.
Introduce a new variable WRK_ENV that contains the environment to use
with SETENVI in all targets that run upstream build commands. Variables
that are common between CONFIGURE_ENV and MAKE_ENV could be moved to
WRK_ENV but for now it just contains a minimal environment:
HOME=${WRKDIR}: Fixes USES=elixir ports that were using the user's HOME.
OSVERSION: For cross building; determines the output of uname -K and
getosreldate(3); affects net/freebsd-telnetd for example.
PATH: Fixes USES=gem ports that were using the user's PATH.
PWD=$${PWD}: Preserve current working directory; affects USES=go ports.
TERM: To preserve colored output to terminals.
TMPDIR: For users who define that.
UNAME_*: For cross building; determines the output of uname(1); affects
lang/python* for example.
This commit deals with everything under Mk/. Ports that have their own
targets running upstream build commands can switch to SETENVI later.
The ports tree adds its definition of ARCH to the MAKEFLAGS environment
variable, which is interpreted by sub-makes as command line arguments,
which means that any definition of ARCH in upstream makefiles was
overridden. The following ports required fixes now that this is no
longer the case.
games/iortcw, games/q3cellshading, games/tremulous:
These use Quake 3 engine code. Fix use of ARCH. Reduce diff between
FreeBSD code and Linux code.
games/legesmotus:
Remove ARCH related patches.
lang/ocaml:
Patch configure script so it detects amd64 correctly. Also make the
powerpc case consistent with the other architectures. This also affects
other ocaml ports like devel/ocaml-ocamlbuild and math/ocaml-num that
include a Makefile.config installed by lang/ocaml. While here, use
SETENVI in check-test target.
net/libnatpmp:
Use of upstream definition of ARCH triggers installation in PREFIX/lib64
on amd64. Disable this.
PR: 276478
Approved by: portmgr (antoine)
Exp-run by: antoine
Framework: Introduce testing feature
Setting WITH_TESTING=yes will cause running `make test` between `stage` and
`package` in the default pipeline.
This feature is off by default.
Sponsored by: Serenity Cybersecurity, LLC
subpackages: fix minor regression
Before subpackages, when running package there where 2 cases:
case 1: ${PACKAGES} directory exist:
packages are created in the work/pkg directory then copies into
${PACKAGES} directory
case 2: ${PACKAGES} does not exist:
packages where only created in work/pkg
After subpackages in the case 2, the packages get copied into the
directory actually running the make package comment.
This change makes the framework behave like before subpackages
Reported by: Antonio Huete Jimenez (tuxilio from Dragonfly irc
channel)
subpackages: fix make flavors-package-names
if the ports has flavors and subpackages then the list of names
are properly displayed 1 per line, but if the ports as no flavors
then it reported everything inline, breaking pkg version and
probably other tools
Reported by: many
Mk/bsd.port.mk: Sunset MANPREFIX
For historical reasons FreeBSD had been using PREFIX/man to install man
pages and a variable MANPREFIX was utilized to do this. While the rest
of the UNIX/Linux world had been mostly using PREFIX/share. As the
first step of moving to PREFIX/share/man this commit removes all the
references to the MANPREFIX variable. Apart from MAKE_ARGS this
variable no longer exists and should not be used to refer to PREFIX
anymore in the future.
The entire shift to PREFIX/share/man will take some more times as there
are around 4000 ports which installs man page to PREFIX/man.
PR: 276551
Approved by: portmgr (exp-run)
features: Add support to enable sanitizers
Can be activated/deactivated globally via
WITH_SANITIZE
Can be activated individualy via
WITH_SANITIZE_PORTS
Each port can individually mark itself as not supporting the feature
via SANITIZE_UNSAFE=
Approved by: bapt, arrowd
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43497
Mk/*: unconditionally use .MAKE.UID and .MAKE.GID
Since FreeBSD 12 has been EOLed, the built-in make(1) variables
.MAKE.UID and .MAKE.GID are always available.
PR: 276259
Approved by: arrowd
Mk/bsd.port.mk: Introduce generic WITH_<FEATURE>_PORTS knob.
This allows enabling any feature supported by Ports Framework for a selected
ports. It was only possible to do WITH_DEBUG_PORTS before.
Differential Revision: https://reviews.freebsd.org/D43369
Approved by: bapt
MAN?PREFIX: undefine those variables
MAN?PREFIX where confusing (people kept messing around with them)
did not bring any real value or functionnality.
Reviewed by: portmgr (mat)
Approved by: portmgr (mat)
Differential Revision: https://reviews.freebsd.org/D43392
subpackages: fix flavors-package-names
Before subpackages was introduced, flavors-package-names was printing
the full <name>-<version>, a regression was introduced with subpackages
which made it print <name>.
One of the side effect of this is pkg version -v -P was determining all
the ports as orphaned.
Reported by: stephen@
component: add SUBPACKAGES
This commit add SUBPACKAGES support to the framework.
Fix users of _LICENSE_DIR
Fix multi/dual license
Add annotation to packages about being a subpkg
Make do-depends aware of the subpackages
Add PKGBASE.subpkg variable
Fix actual-package-depends target
Fix dependencies in sub-packages
Implement LICENSE support
Fix PLIST_FILES.subpkg
Make DESCR.subpkg warning message shorter
Add SUBPACKES to the list of OPTIONS_HELPERS
Fix _strip_perms
Simplify METADIR as in the original patch
Fix _PLIST
Fix the case when there are no subpackages
Fix typo
Fix _PKGDIR initialization
Fix PLIST
Fix typo in RE
Fix METADIR
Fix type in PKGFILE
Fix [build|run]-depends-list targets
Initial import of the subpackage framework
This import is based on https://reviews.freebsd.org/D16457
PR: 275735
Differential Revision: https://reviews.freebsd.org/D40549
*/*: Sunset 12.4-RELEASE/12-STABLE from ports tree
- Remove all references to defunct ARCH arm
- Remove all references to defunct ARCH sparc64
- Remove x11-drivers/xf86-video-sunffb which requires defunct sparc64
ARCH
- Remove sysutils/afbinit requires defunct sparc64 ARCH
- Remove all references to bktr driver
- Remove all references to defunct FreeBSD_12
- Remove all references to OSVERSION/OSREL corresponding to 12
- Remove conditionals in Mk/Uses/cabal.mk
- Remove sparc reference from Mk/Uses/qt-dist.mk
- Remove BROKEN_sparc64/NOT_FOR_ARCH=sparc64
- Remove BROKEN_FreeBSD_12* from:
- Remove OpenSSL patches from:
- Remove conditional flags for OSVERSION >= 1300000 to fixed flags.
Also move conditional flags for non sparc64/arm ARCH to fixed flags.
Reviewed by: brooks, jbeich, rene, salvadore
Differential Revision: https://reviews.freebsd.org/D42068
Mk/bsd.port.mk: Remove duplicate variable in JSON output
Remove duplicate pkg_depends when generating a JSON description of the three
Approved by: delphij@
Fixes: 3d9f300e01f5ecdb140027096c603623264ecc07
Differential Revision: https://reviews.freebsd.org/D42373
Mk/bsd.port.{subdir}.mk: create describe-json
Summary:
Create "describe-json" target to get a JSON-compliant representation of the
ports tree.
It can be invoked from a single port directory, a category directory or from the
ports tree top directory.
It supports FLAVORS. E.g. It is possible to execute the following:
cd math/qalculate-qt && make describe-json-qt6
Performance-wise it is equivalent to a simple "make describe" although it
offers a more complete vision of the port in an easily parseable format.
Times for describe:
1345.39 real 933.06 user 403.01 sys
1317.00 real 929.22 user 406.43 sys
1316.83 real 930.82 user 404.70 sys
1316.75 real 928.05 user 407.39 sys
1316.58 real 930.69 user 404.59 sys
Times for describe-json:
1320.38 real 924.80 user 414.48 sys
1320.66 real 926.14 user 413.41 sys
1320.41 real 924.08 user 415.30 sys
1320.37 real 922.96 user 416.35 sys
1320.25 real 924.25 user 414.95 sys
Some examples assuming the output is saved in the `describe.json` file.
Show all ports in the "accessibility" category:
jq '.accessibility' describe.json
Show ports in the "accessibility" category with a USES=iconv dependency:
jq '.accessibility.[] | select(.uses | index("iconv")) | .pkgorigin'
describe.json
Show ports in the tree that Uses=kmod:
jq '.[].[] | select(.uses | index("kmod")) | .pkgorigin' describe.json
Show ports having a LIB_DEPENDS on devel/binutils:
jq '.[].[] | select(.lib_depends | map(test("devel/binutils")) | any) |
.pkgorigin' describe.json
Show ports in the "database" category which have no maintainer and are marked as
deprecated:
jq '.databases.[] | select(.maintainer=="ports@FreeBSD.org" and .deprecated!="
") | .pkgorigin, .deprecated' describe.json
Approved by: portmgr (bapt@)
Differential Revision: https://reviews.freebsd.org/D42131
sanity: warn about unnused LIB_DEPENDS entries
`stage-qa` already warns about missing dependencies. However, it does not warn
about possibly unneeded ones.
This change tries to address this, by simply walking the list of linked against
shared libraries and then matching the entries of LIB_DEPENDS against them.
Note: this may lead to false positives -- as always, user your brain,
and don't rely on output of static tools alone.
Possible output might look like:
[...]
====> Running Q/A tests (stage-qa)
Warning: you might not need LIB_DEPENDS on libqgpgme.so
Warning: you might not need LIB_DEPENDS on libintl.so
Warning: you might not need LIB_DEPENDS on libKF5IconThemes.so
Warning: you might not need LIB_DEPENDS on libqca-qt5.so
Warning: you might not need LIB_DEPENDS on libQt5Test.so
[...]
Note, that in this case all are false positives.
Differential Revision: https://reviews.freebsd.org/D27304
bsd.sites.mk: Support tag names with USE_GITLAB
Since quite some time, it's possible to download generated tarballs from
gitlab for a tag name without knowing the corresponding git hash. This
is preferable because you have a single source of truth about the
software version.
Support this by replacing GL_COMMIT with GL_TAGNAME which also accepts a
commit hash, similar to USE_GITHUB. Unfortunately, there's a catch, the
DISTFILE must be named exactly: ${GL_PROJECT}-${GL_TAGNAME}.tar.bz2,
otherwise it extracts in a directory that contains the commit hash. So,
we can't add the gitlab account or the revision suffix to make it work.
Therefore, detect whether GL_TAGNAME contains a commit hash, and if it
does, use the old behavior of deriving DISTNAME and DISTFILES.
Document in CHANGES, also add a DEV_WARNING similar to USE_GITHUB when
there's an URL in MASTER_SITES that looks like a gitlab URL. With
support for tags, there shouldn't be any reason left to hardcode such an
URL in MASTER_SITES.
PR: 248967
Approved by: portmgr (tcberner, mentor)
Differential Revision: https://reviews.freebsd.org/D37077