Commit Graph

298 Commits

Author SHA1 Message Date
John Ericson
744d7e7477 *bsdCross: Remove these package sets
I realized what rhelmot did in 61202561d9
(specify what packages just need `stdenvNoLibc`) is definitely the right
approach for this, and adjusted NetBSD and OpenBSD to likewise use it.
With that change, we don't need these confusing and ugly `*bsdCross`
package sets at all!

We can get rid of a lot more libc-related `*Cross`, and I will do so
soon, but this is the first step.

(adapted from commit 51f1ecaa59)
2024-06-21 11:47:36 -04:00
Vladimír Čunát
879821772c
Revert #320852: Clean up cross bootstrapping
It rebuilt stdenv on *-darwin; we can't do that in nixpkgs master.
This reverts commit 2f20501c5f, reversing
changes made to fd469c24af.
2024-06-21 07:48:24 +02:00
John Ericson
1743662e55 *bsd.mkDerivation: Fix comment about STRIPBIN 2024-06-20 10:55:02 -04:00
John Ericson
51f1ecaa59 Clean up cross bootstrapping
For a long time, we've had `crossLibcStdenv`, `*Cross` libc attributes,
and `*bsdCross` pre-libc package sets. This was always bad because
having "cross" things is "not declarative": the naming doesn't reflect
what packages *need* but rather how we *provide* something. This is
ugly, and creates needless friction between cross and native building.

Now, almost all of these `*Cross` attributes are gone: just these are
kept:

- Glibc's and Musl's are kept, because those packages are widely used
  and I didn't want to risk changing the native builds of those at this
  time.

- generic `libcCross`, `theadsCross`, and friends, because these relate
  to the convolulted GCC bootstrap which still needs to be redone.

The BSD and obscure Linux or freestnanding libcs have conversely all
been made to use a new `stdenvNoLibc`, which is like the old
`crossLibcStdenv` except:

1. It usable for native and cross alike

2. It named according to what it *is* ("a standard environment without
   libc but with a C compiler"), rather than some non-compositional
   jargon ("the stdenv used for building libc when cross compiling",
   yuck).

I should have done this change long ago, but I was stymied because of
"infinite recursions". The problem was that in too many cases we are
overriding `stdenv` to *remove* things we don't need, and this risks
cyles since those more minimal stdenvs are used to build things in the
more maximal stdenvs.

The solution is to pass `stage.nix` `stdenvNoCC`, so we can override to
*build up* rather than *tear down*. For now, the full `stdenv` is also
passed, so I don't need to change the native bootstraps, but I can see
this changing as we make things more uniform and clean those up.

Finally, the BSDs also had to be cleaned up, since they have a few
pre-libc dependencies, demanding a systematic approach. I realized what
rhelmot did in 61202561d9 (specify what
packages just need `stdenvNoLibc`) is definitely the right approach for
this, and adjusted NetBSD and OpenBSD to likewise use it.
2024-06-18 17:04:16 -04:00
John Ericson
b6727bbeac netbsd: Fetch source once
The big `fetchCVS` is slow, but a one-time cost. Everything else is much
faster, and not having to manage a gazillion `version` and `sha256`
fields is much easier.

This brings NetBSD in line with how we do FreeBSD and OpenBSD.
2024-06-18 14:11:29 -04:00
Audrey Dutcher
c9b08ff772 freebsd.getent: init 2024-06-17 08:57:44 -07:00
Audrey Dutcher
d942e3fec6 freebsd.pwd_mkdb: init 2024-06-17 08:57:43 -07:00
Audrey Dutcher
27b9567edd freebsd.nscd: init 2024-06-17 08:57:42 -07:00
Audrey Dutcher
b51604ab2a freebsd.mount: init 2024-06-17 08:57:40 -07:00
Audrey Dutcher
c171489cc5 freebsd.top: init 2024-06-17 08:57:39 -07:00
Audrey Dutcher
77177e301e freebsd.sysctl: init 2024-06-17 08:57:37 -07:00
Artemis Tosini
2cc0692eef freebsd.libcxxrt: don't copy unwind headers
These headers conflict with the unwind headers from libunwind
provided by libgcc_eh in `freebsd.libc`.
Upstream FreeBSD does not use these headers in any capacity,
and they cause some incompatibilities since libcxxrt unwind.h
requires _GNU_SOURCE for some functions, while libunwind does not.
2024-06-17 00:36:03 -07:00
John Ericson
c5b1ce10d9
Merge pull request #315176 from rhelmot/freebsd-minimal3/freebsd-various
freebsd: various improvements and new packages
2024-06-16 23:16:31 -04:00
Audrey Dutcher
ae7c4ca17f freebsd.libcxxrt: fixup in preparation for inclusion in stdenv
- add option to build without libcxx
- don't build with libcxx
- distribute headers
2024-06-12 07:41:44 -07:00
Audrey Dutcher
41c2bba81e freebsd.ldd: init 2024-05-31 13:25:22 -07:00
Audrey Dutcher
8d5db1db16 freebsd.iconv: init 2024-05-31 13:25:22 -07:00
Audrey Dutcher
1bc374d91d freebsd.cp: init
While cp is part of freebsd.bin, this particular package is critical for
early stdenv boot and has its own derivation to require fewer
dependencies
2024-05-31 13:25:22 -07:00
Audrey Dutcher
2bf350788c freebsd.bin: init
This is a single derivation containing everything in /bin on a normal
FreeBSD machine, which is an incredibly compact set of core utilities.
2024-05-31 13:25:22 -07:00
Audrey Dutcher
fe0a405397 freebsd.locale: init 2024-05-31 13:25:22 -07:00
Audrey Dutcher
2c41534d75 freebsd.locales: init
The parameters to control which locales are built are placeholders.
2024-05-31 13:25:22 -07:00
Audrey Dutcher
ce0a5ce340 freebsd.localedef: init 2024-05-31 13:25:10 -07:00
Audrey Dutcher
892f600edd freebsd.libcapsicum: init 2024-05-31 10:37:44 -07:00
Audrey Dutcher
7853602867 freebsd.libcasper: init 2024-05-31 10:37:44 -07:00
Audrey Dutcher
ae993bd1e3 freebsd.libdl: init 2024-05-31 10:37:44 -07:00
Audrey Dutcher
a753d385da freebsd.libjail: init 2024-05-31 10:37:44 -07:00
Audrey Dutcher
98587064a0 freebsd.libedit: init 2024-05-31 10:37:44 -07:00
Audrey Dutcher
d792ea2d41 freebsd.{libncurses,libncurses-tinfo}: init
These packages are preferred over libncurses proper for some in-tree
FreeBSD packages.
2024-05-31 10:37:44 -07:00
Audrey Dutcher
95fa436fbe freebsd.libelf: init 2024-05-31 10:37:43 -07:00
Audrey Dutcher
d78f853f7e freebsd.libxo: init 2024-05-31 10:37:43 -07:00
Audrey Dutcher
61202561d9 freebsd.{libc,compat,include}: use no-libs stdenv
Previously, an attribute named isStatic did this, but this was lost in a
refactor. Revive it and rename it to noLibc to be more clear about its
intended use.
2024-05-31 10:37:43 -07:00
Audrey Dutcher
ba5f1b4400 freebsd.mkDerivation: process patches generated with git
The diff parsing was pretty hardcoded for diff -u. Now it should handle
git diff/show as well.
2024-05-31 10:37:43 -07:00
Audrey Dutcher
2785d4f4ae freebsd.filterSource: use a less featureful rsync
By adding fewer dependencies, the FreeBSD native bootstrap tarball
becomes lighter.
2024-05-31 10:37:43 -07:00
Audrey Dutcher
295c645d80 freebsd.boot-install: wrap coreutils install instead of netbsd
netbsd can no longer compile under FreeBSD native early bootstrap
stdenv, so switch to coreutils. This only involves discarding the -l
flag. The -l flag causes a symlink instead of a copy to be installed, so
it is safe to discard during bootstrap.
2024-05-31 10:37:43 -07:00
Audrey Dutcher
bcaca23529 freebsd.compat: re-add lost patch
This patch was applied to 14.0 but not 13.1. It is necessary for 13.1 as
well.
2024-05-31 10:37:43 -07:00
Vladimír Čunát
5804775d03
Merge branch 'staging' into staging-next 2024-05-31 07:30:41 +02:00
Audrey Dutcher
23f95cd5a8 freebsd.libcxxrt: init
This package will be necessary down the line for binary patching
applications built for non-nix FreeBSD. It is additionally being
considered for inclusion in FreeBSD libcxx, both cross and native.
2024-05-30 09:40:46 -07:00
Sigmanificient
8b473d1a27 treewide: remove unused fetch* (and other) arguments 2024-05-30 13:36:48 +02:00
Ali Abrar
888dee445d openbsd: init at 7.5 2024-05-26 10:55:56 -04:00
John Ericson
d9c9da5d65 netbsd.makeMinimal: Make it possible to override the rules
Co-authored-by: Rahul Butani <rrbutani@users.noreply.github.com>
2024-05-26 10:55:15 -04:00
github-actions[bot]
a759c7f2d0
Merge staging-next into staging 2024-05-20 18:01:42 +00:00
Audrey Dutcher
feef074d47 freebsd: Don't discard request to strip installed binaries 2024-05-20 19:18:29 +02:00
sternenseemann
8dbe89fbe0 freebsd: fix eval with Nix < 2.6 2024-05-20 17:56:56 +02:00
Audrey Dutcher
2cc214b4c3 freebsd: 13.1.0 -> 14.0.0
The old patches are kept because the version is actually configurable.
In the future both versions may be exposed.

Co-Auhtored-By: Artemis Tosini <me@artem.ist>
Co-Authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2024-05-11 21:52:31 -04:00
Artemis Tosini
06b05d2289 freebsd: Cleanup, get ready to support version 14
* Extend libc

  Include non-libc core libraries in the libc package. Many of these
  mirror libraries present in glibc on linux, such as libgcc, libraries
  used for iconv, and libraries used for reading kernel info (libkvm,
  libprocstat, libmemstat).

  Without this many packages outside the freebsd tree would need to be
  modified to include standard dependencies which would already be on
  the system for other packages.

* Mark FreeBSD as using LLVM

* Update default LLVM version FreeBSD

* Use patch monolith

  The patchesRoot system combined with the fact that each derivation
  will Request specific names of patches makes it very annoying to use
  other FreeBSD source trees with nixpkgs. This new system allows
  providing one Or more entire trees of patches whose contents will be
  dynamically Parsed and only the relevant patches will be applied for
  any one Derivation.

  With this commit, the following knobs are available for specifying the
  FreeBSD source:

  - overriding `freebsd.versionInfo`, for picking another official
    supported FreeBSD release.

  - overriding `freebsd.source` for specifying a specific unpatched
    FreeBSD source tree.

  - overriding `freebsd.patches`, for specifying the patches to apply.

Co-Authored-by: Audrey Dutcher <audrey@rhelmot.io>
Co-Authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2024-05-11 21:52:07 -04:00
John Ericson
3fe3b055ad bsd treewide: Run RFC formatter 2024-05-06 10:59:45 -04:00
John Ericson
56590dd7b3 netbsd: Remove unneded let-bind 2024-05-06 10:58:23 -04:00
Audrey Dutcher
571f390dd9 freebsd: Only support branch selection via override... for now.
Remove config element for freebsdBranch
2024-05-03 14:18:12 -04:00
Audrey Dutcher
d5972ed69f freebsd: Only export a limited number of attributes to top-level 2024-05-03 14:16:54 -04:00
Audrey Dutcher
da9c1825bc freebsd/{pkgs,patches}: Move patches to version-dependent patches dir 2024-05-03 13:08:44 -04:00
John Ericson
b64a9bb1a9 freebsdBranches{,Cross}: Init
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>
2024-05-03 13:06:34 -04:00
John Ericson
8bbf167e3b freebsd: Include more version info and update
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>`.
2024-05-01 10:25:31 -04:00
John Ericson
22b1e25676 freebsd.mtree: Needs explicit callPackage
Otherwise we get an infinite recursion.

This fixes the bootstrap of FreeBSD, which uses this tool from NetBSD.
2024-04-30 10:39:33 -04:00
Ali Abrar
f0b2aa7354 netbsd: move packages into their own modules 2024-04-22 10:53:59 -04:00
John Ericson
1bcf7a8b53 freebsd: Use's @rhelmot's version infra
This is in preparation for multiple version support, and PR #298849.
2024-04-01 10:45:54 -04:00
Audrey Dutcher
0157c5f328 FreeBSD: Use separate files for packages
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.
2024-03-28 09:41:50 -04:00
Ryan Burns
b79cbf32ea freebsd.libc: fix build with LLVM 16+ 2024-01-02 20:29:57 -08:00
Sergei Trofimovich
3b924de945 netbsd.libcurses: fix eval around NIX_CFLAGS_COMPILE
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
2023-12-27 14:13:46 +00:00
Astro
32ec12551f netbsd.sys: patch nocombreloc linker flag 2023-11-20 03:21:23 +01:00
Astro
26b585aa7b netbsd.sys: make compiler and linker warnings non-fatal 2023-11-20 03:20:24 +01:00
Adam Joseph
cbc8aa437c treewide: use uncurried version of makeScopeWithSplicing 2023-08-14 02:51:10 +03:00
Jan Malakhovski
5852f26bdc treewide: noop: refer to src.name or similar in sourceRoot where appropriate, part 1: trivial cases 2023-08-03 16:32:03 +00:00
Randy Eckenrode
3f948b7664
netbsd.compat: use strip from cctools-port
llvm-strip does not support `-X` for Mach-O, so make sure the cctools
version is used.
2023-07-25 21:28:08 -04:00
Artturin
226e149145 treewide: env.NIX_CFLAGS_COMPILE use optionalString instead of optional
env values must be strings
2023-02-22 21:23:05 +02:00
Artturin
f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
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
2023-02-22 21:23:04 +02:00
Artturin
6f6cc4a22d treewide: use toString on list NIX_CFLAGS_COMPILE
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
2023-02-22 21:23:04 +02:00
github-actions[bot]
d8bfd0a059
Merge master into staging-next 2023-01-23 06:01:12 +00:00
Alyssa Ross
b19185fdb2
libiconv: use libc header on NetBSD
Let's be consistent about this.

Updated netbsd.libc to have a pname attribute so it's compatible with
libcIconv.
2023-01-22 21:11:41 +00:00
John Ericson
39f60a4e54
Merge pull request #210764 from alyssais/mtdev-freebsd
mtdev: add FreeBSD support
2023-01-18 20:23:44 -05:00
Alyssa Ross
079e593d72
evdev-proto: init at 6.0
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.
2023-01-15 17:50:05 +00:00
Alyssa Ross
eaf77e7b0b
freebsd.sed: init at 13.1.0 2023-01-14 19:33:40 +00:00
Alyssa Ross
0a77e09a83
netbsd.libpci: init at 9.2 2023-01-13 04:49:19 +00:00
Alyssa Ross
ce373ba234
netbsd.libarch: init at 9.2 2023-01-13 04:49:17 +00:00
Artturin
58fa78077c treewide: use splicing convenience functions 2022-12-25 14:05:03 +02:00
John Ericson
0afe9d1f70 freebsd packages: Init at 13.1
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
2022-11-04 16:50:26 -04:00
Jan Tojnar
457f28f6f8 Merge branch 'master' into staging-next
; Conflicts:
;	pkgs/development/tools/codespell/default.nix

codespell 2.2.2 switched to pyproject & setuptools_scm:
https://github.com/codespell-project/codespell/pull/2523
2022-10-19 05:24:28 +02:00
Yureka
a25e03e76a
pkgsMusl.netbsd.install: fix build (#196260) 2022-10-19 00:22:54 +02:00
Ryan Burns
d5e1a54ffc netbsd.uudecode: fix build on darwin
Requires explicit link to libresolv
2022-10-17 17:24:44 -07:00
John Ericson
044163d6ef bsd: BSD_PATH rename to COMPONENT_PATH
@alyssais and I agreed this is clearer.
2022-10-06 15:33:36 -04:00
John Ericson
e3137f73fd netbsd.install: Use writeShellScript 2022-10-06 15:33:36 -04:00
John Ericson
dcf7a5ec3d netbsd: Adapt to BSD-common infra changes for FreeBSD
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.
2022-10-06 15:33:28 -04:00
Alyssa Ross
1a80365750
netbsd.libc: fix build
This has been broken since we made -fno-common the default.
2022-10-03 21:52:42 +00:00
Alyssa Ross
2b9c5958a1
netbsd.compat: don't use musl's sys/cdefs.h
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.
2022-01-06 14:22:07 +00:00
Alyssa Ross
7be5fbf70f
pkgsStatic.netbsd: fix nbtool_config.h conflicts
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.
2022-01-06 14:20:18 +00:00
Ryan Burns
577c62aab1 os-specific/netbsd: fix mandoc splicing
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`.
2021-12-10 18:30:37 -08:00
sternenseemann
c271888a89 netbsd.man: fix build
* 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.
2021-11-15 14:26:13 +01:00
Alyssa Ross
f5b089b626 netbsd: add missing rsync native build inputs
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")
2021-11-09 22:53:22 +00:00
Ryan Burns
9eb591df10 netbsd.compat: fix libs by using cctools strip as objcopy
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
```
2021-09-22 17:42:12 -07:00
Ryan Burns
d43df749ac netbsd.compat: fix build on darwin
The makefile requires GNU objcopy
2021-09-19 21:58:33 +09:00
John Ericson
2fdb859716 netbsd: Make hard/soft float match systems settings 2021-09-03 14:20:12 +00:00
John Ericson
ad609d27b5 netbsd.compat: Fix cross compilation
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`.
2021-09-03 14:19:49 +00:00
John Ericson
af58c2cc0c netbsd.compat: Don't configure twice 2021-09-03 03:09:05 +00:00
John Ericson
2810201833 netbsd: Split out path merging from bsd setup hook
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.
2021-07-11 21:11:10 +00:00
John Ericson
75db7f8eb0 netbsd: Use rsync to speed up source merging
The find -exec that was there before is quite slow on my machine. This
is much faster.
2021-07-10 21:20:29 +00:00
github-actions[bot]
f8b7190a42
Merge staging-next into staging 2021-06-10 00:06:44 +00:00
ash lea
3f2e9c6dcc netbsd: add aliases for i486 and i586 2021-06-09 22:10:41 +00:00
github-actions[bot]
4db56e21dc
Merge staging-next into staging 2021-06-07 00:15:20 +00:00
Alyssa Ross
f2c72bca63 netbsd: disable stack protection on i686
Builds fail otherwise, because the linker can't find the stack
protector symbols.
2021-06-06 18:52:58 +00:00
github-actions[bot]
abef57f931
Merge staging-next into staging 2021-05-31 19:44:15 +00:00
Alyssa Ross
7216862bb0 netbsdCross.ld_elf_so: use same stage's libc
We need netbsdCross.ld_elf_so to be the dynamic linker in cross
netbsd's bintools, but netbsdCross doesn't have a libc in stdenv.  So
instead, use netbsdCross.libc for netbsdCross.ld_elf_so.
2021-05-31 14:59:14 +00:00
Alyssa Ross
e65724933b netbsd: 9.1 -> 9.2 2021-05-26 11:46:22 +00:00
Alyssa Ross
4a8dbecd16 netbsd: 8.0 -> 9.1
Notes:

- compat: Needs a header from common merged with it's wrapper.

- librt: Needs the jemalloc sources.

- libc: install libc_pic.a

  This was the behaviour on NetBSD 8.0, and ld.elf_so (in its current
  configuration) requires it.  We could also have disabled PIC in
  ld.elf_so.

- sys: fix build

  We use a more recent version of binutils than NetBSD 9.1 does, so we
  need to backport a patch from CURRENT.

Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2021-05-09 18:56:20 +00:00
John Ericson
a3e54cb582 Merge remote-tracking branch 'upstream/staging-next' into staging 2021-05-06 15:48:25 -04:00
Alyssa Ross
29271ef915 netbsd.libedit: fix build 2021-05-01 12:46:18 +00:00
Alyssa Ross
f27de651fd
netbsd.libcurses: fix build 2021-04-30 13:56:27 +00:00
John Ericson
96b2cb441c
Merge pull request #120283 from Ericson2314/netbsd-fewer-vars
netbsd: Remove some env vars that are probably not needed.
2021-04-23 20:57:18 -04:00
github-actions[bot]
944e32775d
Merge staging-next into staging 2021-04-24 00:16:20 +00:00
John Ericson
b867117b86 netbsd: Remove some env vars that are probably not needed.
Tool setup hooks will set most.
2021-04-23 21:55:09 +00:00
Alyssa Ross
7134116d6b
netbsd.common: just export the sources
"common" is just a lot of shared code, not a component in and of
itself.  There's no Makefile, so if we try to build it Make will go up
a directory and try to build all of NetBSD.
2021-04-23 20:59:57 +00:00
John Ericson
068a59a394
Merge pull request #120355 from alyssais/netbsd-libutil
netbsd.libutil: fix build
2021-04-23 16:56:03 -04:00
Alyssa Ross
554874700a
netbsd.libkern: remove
libkern is only used as part of building the kernel.  There's no
reason for us to have a seperate package for it.
2021-04-23 17:22:06 +00:00
Alyssa Ross
01ea399625
netbsd.libutil: fix build
Tested by building pkgsCross.x86_64-netbsd.netbsd.libutil on
x86_64-linux.
2021-04-23 15:52:30 +00:00
John Ericson
53a2aee7d7
Merge pull request #120347 from alyssais/netbsd-librt
netbsd.librt: fix build
2021-04-23 11:42:34 -04:00
John Ericson
8fec31c93f
Merge pull request #120348 from alyssais/netbsd-librpcsvc
netbsd.librpcsvc: fix build
2021-04-23 11:39:45 -04:00
John Ericson
a45420985f
Merge pull request #120350 from alyssais/netbsd-libpthread
netbsd.libpthread: fix build
2021-04-23 11:39:12 -04:00
Alyssa Ross
e8a81f2f99
netbsd.libcrypt: fix build
Tested by building pkgsCross.x86_64-netbsd.netbsd.libcrypt on
x86_64-linux.
2021-04-23 15:20:41 +00:00
Alyssa Ross
870ce0999b
netbsd.libpthread: fix build
Tested by building pkgsCross.x86_64-netbsd.netbsd.libpthread on
x86_64-linux.
2021-04-23 15:15:30 +00:00
Alyssa Ross
152179f71d
netbsd.librpcsvc: fix build
Tested by building pkgsCross.x86_64-netbsd.netbsd.librpcsvc on
x86_64-linux.
2021-04-23 14:59:58 +00:00
Alyssa Ross
be7a9bab0f
netbsd.librt: fix build
This is another one of those packages that's just a rebuild of a
certain part of libc...

Tested by building pkgsCross.x86_64-netbsd.netbsd.librt on
x86_64-linux.

libc's postPatch was entirely fixes for librt, so move that to librt
and inherit it in libc.
2021-04-23 14:48:35 +00:00
Alyssa Ross
7cdc46f4e3 netbsd.libterminfo: add missing $makeFlags 2021-04-23 14:18:48 +00:00
Alyssa Ross
b4373892ce netbsd.libterminfo: add missing bsdSetupHook dep
82c231d17e ("netbsd: Generalize builder to any-bsd setup hook")
missed libterminfo when it added bsdSetupHook to every other
package.  (I checked it didn't miss anything else.)

It also didn't change a NETBSDSRCDIR to BSDSRCDIR, but in fairness
that line was added about half an hour before the setupHook change was
merged in a16384e118.

Fixes: 82c231d17e ("netbsd: Generalize builder to any-bsd setup hook")
2021-04-23 14:18:48 +00:00
Alyssa Ross
5c24380395
netbsd.libm: fix build
Tested building pkgsCross.x86_64-netbsd.netbsd.libm from x86_64-linux.

At some point we should probably set SHLIBINSTALLDIR in the setupHook,
but I think I'd like to get everything working first, and then make
changes that affect all the builds like that.  It's easier to spot
regressions when you know _everything_ worked before.
2021-04-23 00:17:05 +00:00
John Ericson
e4b05fbf47 netbsd: Make boostrapping more orthodox and don't rely on splicing
- No splicing makes everything less finnicky.

- Normal bootstrapping matches e.g. linux where kernel headers are also
`stdenvNoCC` but part of this stage.
2021-04-22 23:24:24 +00:00
Alyssa Ross
760c0428cb netbsd.i18n_module: fix build
Tested building pkgsCross.x86_64-netbsd.netbsd.i18n_module from
x86_64-linux.
2021-04-22 18:33:14 +00:00
Alyssa Ross
c5ab13fc00 netbsd.libresolv: fix build
Tested building pkgsCross.x86_64-netbsd.netbsd.libresolv from
x86_64-linux.
2021-04-22 18:32:27 +00:00
John Ericson
a16384e118
Merge pull request #119916 from Ericson2314/bsd-setup-hook
netbsd: Generalize builder to any-bsd setup hook
2021-04-22 12:34:47 -04:00
Alyssa Ross
a2d88c63c6 netbsd.libterminfo: fix build
Tested building netbsd.libterminfo and
pkgsCross.x86_64-netbsd.netbsd.libterminfo from x86_64-linux.
2021-04-22 15:58:38 +00:00
John Ericson
82c231d17e netbsd: Generalize builder to any-bsd setup hook
Do this to get ready for other BSDs.
2021-04-22 15:54:32 +00:00
John Ericson
ff94ed255a
Merge pull request #120225 from alyssais/netbsd-libossaudio
netbsd.libossaudio: fix build
2021-04-22 11:53:12 -04:00
Alyssa Ross
8c48bb08d7
netbsd.libossaudio: fix build
The file this was trying to modify doesn't even exist.

Tested by building pkgsCross.x86_64-netbsd.netbsd.libossaudio from
x86_64-linux.
2021-04-22 15:38:07 +00:00
Alyssa Ross
2a16327a83
netbsd.ld_elf_so: fix build
Tested building pkgsCross.x86_64-netbsd.netbsd.ld_elf_so from
x86_64-linux.
2021-04-22 10:34:56 +00:00
John Ericson
5910c5375f netbsd.mkDerviation: remove pointless attrs.src or
`attrs` overrides these defaults already.
2021-04-19 19:49:22 +00:00
Alyssa Ross
ddcb48cc3d
netbsd.sys: actually build the kernel
Before, we were only building the headers, firmware, and bootloader.

CONFIG could be overridden to use another pre-defined kernel, but
there's no way to pass a custom kernel configuration yet.

Tested booting the built kernel in a NetBSD VM.
2021-04-18 19:16:51 +00:00
Alyssa Ross
37ac32a351
netbsd.config: init at 8.0
Needed to build the NetBSD kernel.
2021-04-18 19:04:27 +00:00
Alyssa Ross
3e9decc557
netbsd.cksum: init at 8.0
We need the source directory of this package for config(1), so we
might as well just package it.
2021-04-18 19:04:26 +00:00
John Ericson
3ad122f494
Merge pull request #119793 from alyssais/netbsd-sys
netbsd.sys: fix build
2021-04-18 14:45:37 -04:00
github-actions[bot]
f42b75df03
Merge staging-next into staging 2021-04-18 18:10:40 +00:00
Alyssa Ross
bdb8ec0ce6
netbsd.sys: set platforms
I don't think there's any reason for this not to be set.  Maybe it was
from before netbsd.headers overrode meta.platforms for its
constituents.
2021-04-18 16:46:28 +00:00
Alyssa Ross
d8a6f55942
netbsd: add myself as maintainer 2021-04-18 12:30:22 +00:00
Alyssa Ross
f7e988de8c
netbsd.sys: set FIRMWAREDIR
Otherwise, would try to install firmware to /libdata/firmware.
2021-04-18 12:04:03 +00:00
Alyssa Ross
8603012521
netbsd.sys: add missing uudecode dependency 2021-04-18 12:02:29 +00:00
Alyssa Ross
05e8b0de1a
netbsd.uuencode: init at 8.0
Required to build the NetBSD kernel.
2021-04-18 12:02:28 +00:00
Alyssa Ross
529b539494
netbsd.mkDerivation: popd in moveUsrDir
Permanently changing the directory here was breaking the kernel build,
which needs to do other things after moveUsrDir.
2021-04-18 12:02:25 +00:00
Jörg Thalheim
b2a1e04eed
Merge remote-tracking branch 'upstream/staging-next' into HEAD 2021-04-17 16:37:04 +02:00
Alyssa Ross
ea50a8c811
netbsd.man: fix hash
This was identical to the hash for "misc" above, so was obviously just
a copy and paste error.
2021-04-15 09:24:14 +00:00
Alyssa Ross
93d0f1c237 netbsd.libc: fix build 2021-04-15 03:55:50 +00:00
Alyssa Ross
314aa175d3 netbsd: bison -> byacc
These are only mostly compatible, and libc won't build with bison.
2021-04-15 03:55:50 +00:00
Alyssa Ross
3b5b199012 netbsd.statHook: init
This fixes the build of various NetBSD programs on Linux,
e.g. netbsd.statHook.
2021-04-15 02:59:26 +00:00
Alyssa Ross
2dba1df37e
Revert "netbsd: take fetchcvs from buildPackages to fix eval"
This reverts commit 6dff63294a.

We have a more general fix now, so don't need this any more.
2021-04-14 21:38:23 +00:00
sternenseemann
6dff63294a netbsd: take fetchcvs from buildPackages to fix eval
For some reason fetchcvs was taken from the cross package set when
cross compiling netbsd.* instead of from buildPackages. I suspect that
this was no issue previously because it just could be substituted as it
only ever produced fixed output derivations. However since
00a2084a40 the evaluation of fetchcvs
would depend on `stdenv.cc` (via its openssh dependency). Since
netbsd.libc is required to evaluate stdenv.cc this caused a infinite
recursion when staging the cross stdenv for pkgsCross.amd64-netbsd. The
fix for this is pretty easy: Just take fetchcvs from buildPackages
explicitly instead of hoping for mkDerivation to get it right.

Resolves #119323.
2021-04-14 14:58:08 +00:00
Sandro Jäckel
33a395f195
yacc: deprecate alias
and add a new line after the alphabetically sorting to please my inner monk
2021-04-04 03:18:58 +02:00