summaryrefslogtreecommitdiff
path: root/mk/tools
AgeCommit message (Collapse)AuthorFilesLines
2022-11-24mk: Revert override-tools performance change.jperkin1-29/+24
Unfortunately Linux appears to have a much smaller limit on the number of arguments allowed, so while this change was absolutely fine on many other platforms, on Linux it fails with: bmake[1]: exec(/bin/bash) failed (Argument list too long) It will hopefully be possible to rearchitect the change in a different way to avoid this, while still retaining most of the performance win.
2022-11-23mk: Improve override-tools performance.jperkin1-24/+29
Use bmake loop expansion to create all of the tools within the same shell instance rather than spawning a new one for each, as well as aliases and executable suffixes. Saves over 100 execs per build.
2022-11-23mk: Miscellaneous performance improvements.jperkin1-4/+5
Inline ${RUN} calls where appropriate. Call mkdir directly rather than via a shell when invoked as a single command. Avoid unnecessary mkdir calls.
2022-11-23mk: Only create GNU missing wrappers when needed.jperkin3-8/+12
There is no point creating wrappers that warn about missing particular autoconf, automake, and intltool commands if we aren't using GNU configure at all. Saves around 140 execs for every package without GNU_CONFIGURE=yes.
2022-11-22mk/tools: Don't ever use GNU false instead of builtin.jperkin1-5/+1
2022-11-22mk/tools: Avoid print(1) when using bash on SunOS.jperkin1-1/+16
bash does not have a print builtin, and on SunOS there is a /usr/bin/print which is found by the libtool configure script (which has also made its way into lots of third-party packages) and used for printing strings. Create a broken print wrapper so that this is not found and the printf builtin is used instead, significantly improving performance.
2022-11-22mk/tools: Switch to pwd builtin on SunOS.jperkin1-2/+2
pkgsrc switched to using /bin/pwd back in 2003 due to some undocumented errors in buildlink2, but I don't see any failures with this in bulk builds and it avoids a large number of unnecessary execs. Limited to SunOS for now as that's all I've tested, but other platforms are more than welcome to follow suit.
2022-11-22mk/tools: Sync comments with reality.jperkin1-5/+4
2022-11-16mk: Avoid egrep/fgrep wrappers when using GNU grep.jperkin1-4/+7
A recent GNU grep release has started to add obnoxious warnings when calling egrep/fgrep, so use grep with -E or -F flags respectively to avoid them.
2022-10-07mk: Avoid unnecessary separate shell invocation.jperkin1-2/+2
Reduces number of shells invoked during tools phase by around 100, and improves performance by around 10%.
2022-09-29Remove support for Bitrig.charlotte1-89/+0
2022-07-24mk: do not set TOOLS_PATH.pkgconfig, defaulting to 'false' as replacementwiz1-2/+1
2022-07-22mk: if pkg-config is not in USE_TOOLS, create a false(1) wrapper for itwiz1-1/+8
2022-07-05tools: re-add (accidentally?) dropped realpathmarkd1-1/+4
2022-05-24mk: Use OPSYS_VERSIONnia1-2/+2
2022-05-09tools.Linux.mk: set TOOLS_PLATFORM.date.schmonz1-1/+4
2022-05-01mk: Initial support for NixOS (Linux variant)nia1-288/+288
A particular challenge for pkgsrc on NixOS is that it usurps all Unix conventions and stores its system binaries and libraries in a crazy system of hashed sub-directories: $ which ls /run/current-system/sw/bin/ls $ ls -l /run/current-system/sw/bin/ls Lrwxrwxrwx 1 root root 65 Jan 1 1970 /run/current-system/sw/bin/ls -> /nix/store/xs02fpnpkq frhqqfsxx3lpj48wrapd00-coreutils-8.32/bin/ls We can make a "best effort" attempt to accomodate this by invoking the compiler to figure out where libc is. In general, it's required to adjust the Linux files to make fewer assumptions about the layout of the filesystem. However, since using a compiler and libc from NixOS results in /nix/store paths being embedded in binaries, running the NixOS "garbage collector" can result in binaries installed from pkgsrc becoming unusable. Use with care: $ readelf -a ~/pkg/bin/perl | grep nix [Requesting program interpreter: /nix/store/p5sam91qwz995pi0160rfr7dkh6pibil-glibc-2.32 -39/lib/ld-linux-aarch64.so.1] 0x000000000000001d (RUNPATH) Library runpath: [/home/nia/pkg/lib:/home/nia/pkg/li b/perl5/5.32.0/aarch64-linux/CORE:/nix/store/p5sam91qwz995pi0160rfr7dkh6pibil-glibc-2.32-39/l ib:/nix/store/vv9nz0bwv1pfl70w14k7dgz6yx7hjwxk-gcc-9.3.0-lib/lib] Apparently, the "stdenv.cc" package must be installed prior to bootstrapping pkgsrc. I worked on this patch last year for a friend who wanted to test something on pkgsrc but had no other system available.
2022-04-16tools: Expose NATIVE_AR and NATIVE_RANLIB for cross-builds.riastradh1-1/+4
2022-04-04mk: Cross-eyed hacks to support cross-libtool.riastradh4-19/+19
For a long time, when cross-building, say from native=amd64 to target=powerpc, it was necessary to: 1. cross-build a _powerpc_ package called cross-libtool-base-powerpc, and then 2. install the powerpc package _natively_ with `pkg_add -m x86_64' to override the architecture check that normally forbids this kind of shenanigans, in order to cross-build anything that uses libtool as a tool. This is partly because libtool doesn't follow the normal GNU convention of `./configure --build=<native platform> --host=<platform package will run on> --target=<platform package is configured to operate on>' -- in this example, build=amd64, host=amd64, target=powerpc. Instead, libtool expects to be cross-built itself, even if it's going to run as a tool. It's not as bonkers as it sounds at first: libtool is just a shell script, and it caches various information about the (cross-building!) toolchain it is built with so it can use that information later when it is run as a tool itself to cross-compile other software. To make this work, we need to create the toolchain wrappers for libtool _as if_ we were cross-building even if we are building a native package. So mk/tools uses a new flag TOOLS_USE_CROSS_COMPILE instead of USE_CROSS_COMPILE, and libtool internally sets MACHINE_ARCH=${TARGET_ARCH} (in the example above, powerpc) to make it look like we're cross-building. The new TOOLS_CROSS_DESTDIR is an alias for the (defaulted) CROSS_DESTDIR, which must now be set unconditionally in mk.conf in order for libtool to know where the cross-destdir will be; _CROSS_DESTDIR remains empty when building any native packages (including the native cross-libtool package). Finally, we need to make the resulting package be a native package, with MACHINE_ARCH set to the one that it will be installed on (in the example above, amd64), so I added an indirection _BUILD_DEFS.${var} to replace var on its own in the build definitions that get baked into the package, shown by `pkg_info -B'. Setting _BUILD_DEFS.MACHINE_ARCH=${NATIVE_MACHINE_ARCH} ensures that this mutant hybrid cross-built libtool still produces a native package. All of this logic is gated on setting USE_CROSS_COMPILE in mk.conf or LIBTOOL_CROSS_COMPILE in the package makefile, so it should be safe for non-cross-builds -- when USE_CROSS_COMPILE=no and you're not building cross-libtool, everything is as before.
2022-04-03mk/tools: Fix readelf for cross-compilation on NetBSD.riastradh1-1/+3
This is needed by check-pie.
2022-01-09SunOS: add native tool paths for xz & xzcattnn1-1/+7
Spotted on OpenIndiana, provided by compress/xz pkg
2022-01-06Extract .zst distfiles using archivers/zstd.schmonz2-2/+13
2021-11-29mk: Use OPSYS_VERSION where appropriate.jperkin1-2/+2
Should improve readability and in some cases avoid potential failure due to string comparisons being used. No other functional change intended.
2021-10-26mk: Bump DIGEST_RQED. Needed for blake2s. Pointed out by agc, thanksnia1-2/+2
2021-10-22mk: Use native bsdtar on NetBSD 9.0 onwards.jperkin1-2/+2
Relying on native variables like MKBSDTAR only works when using the native make, and should be avoided as they are not set when using a bootstrap. Should fix build of lang/go117 with bootstrapped NetBSD, as bsdtar from pkgsrc is unable to handle the distfile due to locale errors.
2021-07-19mk: Fix PR pkg/56299triaxx1-1/+15
Add a test to check that an xbase set is installed when a tool depends on X11 and X11_TYPE=native. Thanks to Greg and Edgar for their comments and suggestions!
2021-05-02mk/tools: gdbus-codegen is in devel categoryryoon1-2/+2
2021-05-02*: Use the tools framework for gdbus-codegennia2-1/+19
2021-05-02*: Use the tools framework for itstoolnia2-1/+19
Now it should be more obvious when a package needs it as a dependency, as it will fail loudly if it isn't declared as a tool. While here, some duplicate dependencies on itstool were removed from the MATE packages
2021-03-15mk: Add preliminary support for MidnightBSDryoon1-0/+103
It is almost as same as FreeBSD.
2021-01-19mk/tools: Avoid native GNU make/m4 on all Darwin systems.jperkin1-7/+13
Previously this was only done on Big Sur to work around the issue where XCode does not support running these programs via a symlink, breaking .tools/bin. However, with the update to autoconf 2.70, the native GNU m4 from 2006 on all Darwin systems is too old and breaks the build on Catalina and older, causing massive dependency failures. Avoiding them both completely at this time is the simplest way forward.
2020-12-09Reflect GNU grep locations on some SunOS variantsgutteridge1-1/+3
2020-12-05tools.Linux.mk: Consider /bin/find as welljs1-1/+5
2020-10-10mk: Stop using XCode binaries on Big Sur.jperkin1-2/+6
These no longer support being executed via a symlink, failing with errors such as: xcode-select: Failed to locate 'gmake', and no install could be requested This breaks the entire .tools/bin directory, so we just have to avoid them and use tools from pkgsrc instead. It's likely a lot more will need to be added to this list, but this is enough to get devel/cmake building at least.
2020-10-06mk: fix undefined variables for current make running in -dL moderillig1-2/+2
In lint mode, NetBSD's make is stricter about undefined variables. In conditions, the function arguments must be fully defined.
2020-05-28mk/tools: not all linuxes have bash (e.g. alpine)nia1-1/+3
2020-05-13mk/tools/bsd.tools.mk: list _USE_TOOLS in show-all-toolsrillig1-2/+3
This variable is used in quite a few places, which makes it interesting enough, even though it is an implementation detail.
2020-05-10mk/tools: don't create empty symlink for wrong tool definitionrillig1-4/+4
This case can only happen in the following special case: TOOLS_CREATE+= asdf TOOLS_PATH.asdf= # empty If there is a lonely TOOLS_CREATE without a corresponding TOOLS_PATH, it defaults to ${FALSE} and thus doesn't trigger this code.
2020-05-10mk/tools/perl.mk: allow to silence the USE_TOOLS+=perl warningrillig1-4/+11
Packages that don't declare USE_TOOLS+=perl and whose configure script invokes perl produce a warning. Usually warnings are ignored, but they can also be configured as errors, for example during a strict bulk build. In this situation it is necessary to override the default behavior of the perl tool to fail silently. Up to now, defining both TOOLS_BROKEN+=perl and TOOLS_FAIL+=perl produced a duplicate make target. To handle this situation, let TOOLS_BROKEN+=perl take precedence over TOOLS_FAIL+=perl. This is much easier than finding out in each case how to disable the perl check in the configure script, which is most often done by adding any of the following to CONFIGURE_ENV: PERL=#none, ac_cv_prog_PERL=#none, ac_cv_path_PERL=#none.
2020-05-09mk/tools/create.mk: make tool wrappers smallerrillig1-2/+2
There is no need to include the comments from the shquote function.
2020-05-09mk/tools/bsd.tools.mk: include _TOOLS_VARNAME in show-all-toolsrillig1-1/+2
This information is useful for getting the variable name that corresponds to a tool. In most cases this is just the uppercase name of the tool, but there are exceptions like ${SETENV} for env, ${HOSTNAME_CMD} for hostname.
2020-05-09mk/tools/create.mk: add new variable TOOLS_ALWAYS_WRAP for debuggingrillig1-2/+10
2020-03-13mk/tools: in show-all-tools, sort tool variables by relevancerillig1-7/+7
Before, these variables were sorted alphabetically, which made the output more difficult to read.
2020-02-25put back bsdtar as host tool, conditional on MKBSDTARtnn1-1/+4
http://mail-index.netbsd.org/source-changes/2020/01/17/msg112935.html
2020-02-13tools/tools.NetBSD.mk: Register TOOLS_PLATFORM.realpathkamil1-1/+4
2019-11-21remove bsdtar as tool because it was reverted in src for some reason ...tnn1-4/+1
2019-09-06NetBSD 9 or later has bsdtar as /bin/tarryoon1-1/+4
2019-06-06mk/tools: Ensure GNU grep is used when requested.jperkin1-1/+2
Previously a "grep" tool was created, but GREP still pointed at the platform grep, breaking any package that used the environment variables rather than PATH when the native platform grep does not have GNU features.
2019-05-22mk/tools: in the wrapper log, quote arguments containing = naturallyrillig1-3/+17
2019-05-15mk/tools: Add support for autoconf*:test and automake*:testleot2-2/+10
Thanks to <martin> for catching the unintended autoconf tool dependency!