Commit Graph

270 Commits

Author SHA1 Message Date
Audrey Dutcher
c94a2a2435 freebsd.limits: init 2024-07-02 20:18:52 -07:00
Audrey Dutcher
f80a34ddb2 freebsd.id: init 2024-07-02 20:18:52 -07:00
Audrey Dutcher
22a4ba421e freebsd.protect: init 2024-07-02 20:18:51 -07:00
Audrey Dutcher
a25eb642f7 freebsd.rcorder: init 2024-07-02 20:18:51 -07:00
Audrey Dutcher
95bed7c788 freebsd.rc: init 2024-07-02 20:18:51 -07:00
Audrey Dutcher
b85f78bfa8 freebsd.login: init 2024-07-02 20:18:51 -07:00
Audrey Dutcher
d58f00efe2 freebsd.libradius: init 2024-07-02 20:18:51 -07:00
Audrey Dutcher
4fdc9f9d17 freebsd.libbsm: init 2024-07-02 20:18:51 -07:00
Audrey Dutcher
6e52c40871 freebsd.libpam: init 2024-07-02 20:18:51 -07:00
Audrey Dutcher
7ada439627 freebsd.cap_mkdb: init 2024-07-02 20:18:51 -07:00
Audrey Dutcher
a20e099c9a freebsd.getty: init 2024-07-02 20:18:39 -07:00
John Ericson
56c2439a45 openbsd.libc: Create from constituent pkgs not hack
9d4e3b597fded2aee92cb7a7b2195072f812a6d3 but for OpenBSD instead of
NetBSD.
2024-06-29 12:48:30 -04:00
John Ericson
716d8a752a openbsd: Remove STRIP hack
This is just a FreeBSD thing, not OpenBSD or NetBSD thing.
2024-06-29 12:48:29 -04:00
John Ericson
b98dc9f0ef bsdSetupHook: Do not define empty DESTDIR
This breaks OpenBSD, and isn't actually needed for the others after all.
2024-06-29 12:48:29 -04:00
John Ericson
f9dbc8f83e netbsd.libcMinimal: Cut down on deps, don't build tags
We have a similar patch for OpenBSD too. FreeBSD didn't need it because
they removed a tags special case for libc.
2024-06-29 11:32:50 -04:00
John Ericson
c08bf286c5 netbsd.libpthread{,-headers}: Inline base.nix
It is just one line and thus not worth factoring out.
2024-06-21 18:38:17 -04:00
John Ericson
0281c72ed3 netbsd: let-bind buildNetbsd
This way there is less "knowing our own name".
2024-06-21 18:38:17 -04:00
John Ericson
0bf10957e2 netbsd: Sort top package set file 2024-06-21 18:38:17 -04:00
John Ericson
e34c3f7856 netbsd.libc: Create from constituent pkgs not hack
The old `postInstall` was ugly, and made for a needlessly course-grained
package. This makes more smaller derivations, and ones that additionally
can be built in parallel.
2024-06-21 17:06:37 -04:00
John Ericson
8cc7430d51 netbsd.libc: Use multiple outputs
Generally good practice.
2024-06-21 16:55:16 -04:00
John Ericson
94424da4fc netbsd: Remove a bunch of unneeded rsync deps
Now that we assemble the source code per each package in a separate prep
derivation since b6727bbeac, we don't need
rsync in the package proper derivations.
2024-06-21 16:55:16 -04:00
John Ericson
80d3b5dbf9 netbsd: No _mainLibcExtraPaths
These didn't actually affect `netbsd.compat`, so I inlined the variable
back to `libc` again.
2024-06-21 16:55:14 -04:00
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