This creates multiple package sets for different versions. The other
versions don't yet work, but that will be fixed in subsequent PRs.
Push versionData into package set so that it can be overridden
Co-Authored-By: Audrey Dutcher <audrey@rhelmot.io>
Co-Authored-By: Artemis Tosini <me@artem.ist>
We want to know the minor versions.
We want to know the patch versions too, where possible. We get those
either from the branch when it is the form `RELEASE-p<patch>`, or from
the tag when its in the form `release/<major>.<minor>.<patch>`.
There are a number of packages that we ought to be able to autocall, but
cannot because we need to add manual arguments just to avoid splicing.
This sucks but is the right call for now --- the conclusion should be
not that auto-calling is bad, but that splicing is bad.
This tries to do nothing but move things around; hashes are almost
unchanged. @rhelmot then has more changes to do on top of this, which
will be easier to review since code will be modified in place rather
than moved around and modified at the same time.
Without the change the eval fails as:
$ nix build --no-link -f. netbsd.libcurses
...
… while evaluating attribute 'NIX_CFLAGS_COMPILE' of derivation 'libcurses-netbsd-9.2'
error: value is a string while a list was expected
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper
this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
FreeBSD implements Linux's evdev API, but doesn't come with headers
for it. Instead, the Linux headers are just modified to be suitable
for FreeBSD, via a port called evdev-proto. I don't want to copy the
complicated sed expressions from the port into Nixpkgs, so instead we
just build and install the port inside a Nix derivation.
Always set `SRCTOP`, set it with abs path
llvmPackages: Bump minimum version for FreeBSD
llvmPackages_*, libgcc, compiler_rt: Hack in enough libs that one can compiler C
freebsd.compat: Rename some things to work around cc-wrapper change
0bea4a194f / #191724 in particular
See https://github.com/NixOS/nixpkgs/pull/82131 for the rest of the
changes for FreeBSD. This is PRed separately because it is a macOS
moderate rebuild so we target staging.
The main change is that we CD to the path we're building *after*
applying patches, so we can patch other parts of the tree (from
`extraPaths`) as needed.
Another change is that `netbsd.install` no longer depends on `fts`,
which it evidently no longer needs.
When building glib statically, a Meson check would fail, because the
check would interpret any warning as failure, and it would see the
warning that the musl sys/cdefs.h emits about the file being
deprecated.
In pkgsStatic, /all/ build inputs are propagated. This means that
netbsd.compat was propagated, along with its setup hook, which broke
static glib builds because glib defines a function with the same name
as one in nbtool_config.h, and nbtool_config.h was being automatically
included in every C file processed by the compiler, in any transitive
dependent of netbsd.compat's setup hook.
To fix this, rather than forcing nbtool_config.h to be included for
_every_ C file in a derivation that depends on netbsd.compat, modify
the NetBSD-specific mkDerivation to detect files that need the header,
and patch it in there where appropriate. That way, only files that
are part of NetBSD will be affected, not all transitive dependents.
This expression is not properly spliced, so we need to
manually specify buildPackages so that mandoc will not
be built for the host platform
Fixes cross-compilation of netbsd.* packages that depend
on mandoc in nativeBuildInputs, such as `getent`.
* Fails because it's missing ps2pdf. In the beginning I fixed this by
providing ghostscript as a nativeBuildInput, but the PDF created for
man0 doesn't appear to be installed, so we can just patch out the call
to the tool.
* We need to disable MKRUMP or provide sys/rump/share/man in sourceRoot,
opted for the former since it's simpler at the moment, but the latter
is also possible with a custom unpackPhase.
Using extraPaths in NetBSD packages now requires rsync, but the rsync
dependency wasn't added to all the packages using extraPaths that
override nativeBuildInputs, so they'd just fail immediately.
Fixes: 75db7f8eb0 ("netbsd: Use rsync to speed up source merging")
Reverts d43df749ac
NetBSD makefiles strip local symbols from libs using `OBJCOPY?=objcopy`,
which is missing on macOS. GNU objcopy appears to succeed but produces
broken .a libs which do not link into dependers.
(As this issue does not fail the netbsd.compat build,
downstream netbsd.install is added to passthru.tests.)
Since `OBJCOPY` is only used for stripping, we can:
* skip stripping with the hacky `OBJCOPY=echo`
* use cctools strip, which is invoked in the same way
The latter is obviously preferable if it works.
Indeed, locals are stripped, although it doesn't affect size much.
Comparison:
`OBJCOPY=echo`:
```
$ du -b result/lib/*.a
347784 result/lib/libnbcompat.a
357120 result/lib/libnbcompat_p.a
```
`OBJCOPY=${cctools}/bin/strip`:
```
$ du -b result/lib/*.a
347008 result/lib/libnbcompat.a
357120 result/lib/libnbcompat_p.a
```
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
I plan on doing the sources for FreeBSD differently. Indeed we might
want to change this for NetBSD too eventually.
In any event, the way we manage sources is not intrinsically the same
across BSDs so it makes sense to pull this out.