diff options
Diffstat (limited to 'pkgs/os-specific')
143 files changed, 2094 insertions, 638 deletions
diff --git a/pkgs/os-specific/bsd/freebsd/lib/default.nix b/pkgs/os-specific/bsd/freebsd/lib/default.nix index d022f7cfa14c6..3fea3bc3e7f22 100644 --- a/pkgs/os-specific/bsd/freebsd/lib/default.nix +++ b/pkgs/os-specific/bsd/freebsd/lib/default.nix @@ -1,4 +1,8 @@ -{ version }: +{ + version, + lib, + writeText, +}: { inherit version; @@ -15,4 +19,65 @@ .${stdenv'.hostPlatform.parsed.cpu.name} or stdenv'.hostPlatform.parsed.cpu.name; install-wrapper = builtins.readFile ../../lib/install-wrapper.sh; + + # this function takes a list of patches and a list of paths and returns a list of derivations, + # one per file that is patched, containing the actual patch contents. This allows us to have + # extract only the patches that are relevant for a given subset of the source tree. + # note: the "list of patches" input can be a directory containing patch files, a path or a list of valid inputs to this argument, recursively. + filterPatches = + patches: paths: + let + isDir = + file: + let + base = baseNameOf file; + type = (builtins.readDir (dirOf file)).${base} or null; + in + file == /. || type == "directory"; + consolidatePatches = + patches: + if (lib.isDerivation patches) then + [ patches ] + else if (builtins.isPath patches) then + (if (isDir patches) then (lib.filesystem.listFilesRecursive patches) else [ patches ]) + else if (builtins.isList patches) then + (lib.flatten (builtins.map consolidatePatches patches)) + else + throw "Bad patches - must be path or derivation or list thereof"; + consolidated = consolidatePatches patches; + splitPatch = + patchFile: + let + allLines' = lib.strings.splitString "\n" (builtins.readFile patchFile); + allLines = builtins.filter ( + line: !((lib.strings.hasPrefix "diff --git" line) || (lib.strings.hasPrefix "index " line)) + ) allLines'; + foldFunc = + a: b: + if ((lib.strings.hasPrefix "--- " b) || (lib.strings.hasPrefix "diff --git " b)) then + (a ++ [ [ b ] ]) + else + ((lib.lists.init a) ++ (lib.lists.singleton ((lib.lists.last a) ++ [ b ]))); + partitionedPatches' = lib.lists.foldl foldFunc [ [ ] ] allLines; + partitionedPatches = + if (builtins.length partitionedPatches' > 1) then + (lib.lists.drop 1 partitionedPatches') + else + (throw "${patchFile} does not seem to be a unified patch (diff -u). this is required for FreeBSD."); + filterFunc = + patchLines: + let + prefixedPath = builtins.elemAt (builtins.split " |\t" (builtins.elemAt patchLines 1)) 2; + unfixedPath = lib.path.subpath.join (lib.lists.drop 1 (lib.path.subpath.components prefixedPath)); + in + lib.lists.any (included: lib.path.hasPrefix (/. + ("/" + included)) (/. + ("/" + unfixedPath))) ( + paths + ); + filteredLines = builtins.filter filterFunc partitionedPatches; + derive = patchLines: writeText "freebsd-patch" (lib.concatLines patchLines); + derivedPatches = builtins.map derive filteredLines; + in + derivedPatches; + in + lib.lists.concatMap splitPatch consolidated; } diff --git a/pkgs/os-specific/bsd/freebsd/package-set.nix b/pkgs/os-specific/bsd/freebsd/package-set.nix index 4ff6cb2102490..e9f45ed64c709 100644 --- a/pkgs/os-specific/bsd/freebsd/package-set.nix +++ b/pkgs/os-specific/bsd/freebsd/package-set.nix @@ -7,6 +7,7 @@ versionData, buildFreebsd, patchesRoot, + writeText, }: self: @@ -39,6 +40,7 @@ lib.packagesFromDirectoryRecursive { ] ) ); + inherit lib writeText; }; # The manual callPackages below should in principle be unnecessary, but are diff --git a/pkgs/os-specific/bsd/freebsd/patches/14.0/libcxxrt-headers.patch b/pkgs/os-specific/bsd/freebsd/patches/14.0/libcxxrt-headers.patch index 256db9e2d9cf4..a1418bd499753 100644 --- a/pkgs/os-specific/bsd/freebsd/patches/14.0/libcxxrt-headers.patch +++ b/pkgs/os-specific/bsd/freebsd/patches/14.0/libcxxrt-headers.patch @@ -4,7 +4,7 @@ SRCS+= terminate.cc SRCS+= typeinfo.cc -+INCS+=cxxabi.h unwind.h unwind-arm.h unwind-itanium.h ++INCS+=cxxabi.h + WARNS?= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ diff --git a/pkgs/os-specific/bsd/freebsd/patches/14.0/libifconfig-no-internal.patch b/pkgs/os-specific/bsd/freebsd/patches/14.0/libifconfig-no-internal.patch new file mode 100644 index 0000000000000..a84ca0ff89ffd --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/patches/14.0/libifconfig-no-internal.patch @@ -0,0 +1,36 @@ +diff --git a/lib/libifconfig/Makefile b/lib/libifconfig/Makefile +index 6bdb202bec1d..ebc626901cfc 100644 +--- a/lib/libifconfig/Makefile ++++ b/lib/libifconfig/Makefile +@@ -1,7 +1,6 @@ + + PACKAGE= lib${LIB} + LIB= ifconfig +-INTERNALLIB= true + + LIBADD= m + +@@ -36,8 +35,8 @@ SRCS+= ${GEN} + CLEANFILES+= ${GEN} + + # If libifconfig become public uncomment those two lines +-#INCSDIR= ${INCLUDEDIR} +-#INCS= libifconfig.h libifconfig_sfp.h libifconfig_sfp_tables.h ++INCSDIR= ${INCLUDEDIR} ++INCS= libifconfig.h libifconfig_sfp.h libifconfig_sfp_tables.h + + #MAN= libifconfig.3 + +diff --git a/lib/libifconfig/Symbol.map b/lib/libifconfig/Symbol.map +index 2d80fb31652a..8b08947112e5 100644 +--- a/lib/libifconfig/Symbol.map ++++ b/lib/libifconfig/Symbol.map +@@ -2,6 +2,8 @@ FBSD_1.6 { + ifconfig_bridge_get_bridge_status; + ifconfig_bridge_free_bridge_status; + ifconfig_carp_get_info; ++ ifconfig_carp_get_vhid; ++ ifconfig_carp_set_info; + ifconfig_close; + ifconfig_create_interface; + ifconfig_create_interface_vlan; diff --git a/pkgs/os-specific/bsd/freebsd/patches/14.0/mount-use-path.patch b/pkgs/os-specific/bsd/freebsd/patches/14.0/mount-use-path.patch new file mode 100644 index 0000000000000..614c327dda69a --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/patches/14.0/mount-use-path.patch @@ -0,0 +1,18 @@ +diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c +index 2fcc94e40818..7de6da1bb20e 100644 +--- a/sbin/mount/mount.c ++++ b/sbin/mount/mount.c +@@ -155,12 +155,9 @@ exec_mountprog(const char *name, const char *execname, char *const argv[]) + EXIT(1); + case 0: /* Child. */ + /* Go find an executable. */ +- execvP(execname, _PATH_SYSPATH, argv); ++ execvp(execname, argv); + if (errno == ENOENT) { + xo_warn("exec %s not found", execname); +- if (execname[0] != '/') { +- xo_warnx("in path: %s", _PATH_SYSPATH); +- } + } + EXIT(1); + default: /* Parent. */ diff --git a/pkgs/os-specific/bsd/freebsd/patches/14.0/rc-user.patch b/pkgs/os-specific/bsd/freebsd/patches/14.0/rc-user.patch new file mode 100644 index 0000000000000..27e8f9a13f211 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/patches/14.0/rc-user.patch @@ -0,0 +1,17 @@ +diff --git a/libexec/rc/rc b/libexec/rc/rc +index 0ea61a4b2c0a..d9bfb228224c 100644 +--- a/libexec/rc/rc ++++ b/libexec/rc/rc +@@ -87,6 +87,12 @@ if ! [ -e ${firstboot_sentinel} ]; then + skip_firstboot="-s firstboot" + fi + ++if [ -z "$USER_LOGIN" ]; then ++ skip="$skip -s user" ++else ++ skip="$skip -k user" ++fi ++ + # Do a first pass to get everything up to $early_late_divider so that + # we can do a second pass that includes $local_startup directories + # diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/bintrans.nix b/pkgs/os-specific/bsd/freebsd/pkgs/bintrans.nix new file mode 100644 index 0000000000000..d10426e26ca1b --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/bintrans.nix @@ -0,0 +1,5 @@ +{ mkDerivation }: +mkDerivation { + path = "usr.bin/bintrans"; + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/bsdlabel.nix b/pkgs/os-specific/bsd/freebsd/pkgs/bsdlabel.nix new file mode 100644 index 0000000000000..45d5516ecc78d --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/bsdlabel.nix @@ -0,0 +1,6 @@ +{ mkDerivation, libgeom }: +mkDerivation { + path = "sbin/bsdlabel"; + extraPaths = [ "sys/geom" ]; + buildInputs = [ libgeom ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/cap_mkdb.nix b/pkgs/os-specific/bsd/freebsd/pkgs/cap_mkdb.nix new file mode 100644 index 0000000000000..d579b5605bcf2 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/cap_mkdb.nix @@ -0,0 +1,6 @@ +{ mkDerivation }: +mkDerivation { + path = "usr.bin/cap_mkdb"; + + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/daemon.nix b/pkgs/os-specific/bsd/freebsd/pkgs/daemon.nix new file mode 100644 index 0000000000000..b7c29ccfc2a51 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/daemon.nix @@ -0,0 +1,5 @@ +{ mkDerivation }: +mkDerivation { + path = "usr.sbin/daemon"; + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/devfs.nix b/pkgs/os-specific/bsd/freebsd/pkgs/devfs.nix new file mode 100644 index 0000000000000..8fc29aa382d6f --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/devfs.nix @@ -0,0 +1,10 @@ +{ mkDerivation }: +mkDerivation { + path = "sbin/devfs"; + + # These config files are mostly examples and not super useful + # in nixbsd + postPatch = '' + sed -i 's/^CONFS=.*$//' $BSDSRCDIR/sbin/devfs/Makefile + ''; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/dmesg.nix b/pkgs/os-specific/bsd/freebsd/pkgs/dmesg.nix new file mode 100644 index 0000000000000..f2412ff557666 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/dmesg.nix @@ -0,0 +1,6 @@ +{ mkDerivation, lib }: +mkDerivation { + path = "sbin/dmesg"; + + meta.platforms = lib.platforms.freebsd; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod-firmware.nix b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod-firmware.nix new file mode 100644 index 0000000000000..002b9276cf5b7 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod-firmware.nix @@ -0,0 +1,54 @@ +{ + lib, + mkDerivation, + fetchFromGitHub, + buildFreebsd, + sys, + withAmd ? true, + withIntel ? true, +}: +mkDerivation rec { + pname = + "drm-kmod-firmware" + lib.optionalString withAmd "-amd" + lib.optionalString withIntel "-intel"; + + version = "20230625_8"; + + src = fetchFromGitHub { + owner = "freebsd"; + repo = "drm-kmod-firmware"; + rev = version; + hash = "sha256-Ly9B0zf+YODel/X1sZYVVUVWh38faNLhkcXcjEnQwII="; + }; + + extraNativeBuildInputs = [ buildFreebsd.xargs-j ]; + + hardeningDisable = [ + "pic" # generates relocations the linker can't handle + "stackprotector" # generates stack protection for the function generating the stack canary + ]; + + # hardeningDisable = stackprotector doesn't seem to be enough, put it in cflags too + NIX_CFLAGS_COMPILE = "-fno-stack-protector"; + + KMODS = + lib.optional withIntel "i915kmsfw" + ++ lib.optionals withAmd [ + "amdgpukmsfw" + "radeonkmsfw" + ]; + + env = sys.passthru.env; + SYSDIR = "${sys.src}/sys"; + + KMODDIR = "${builtins.placeholder "out"}/kernel"; + + meta = { + description = "GPU firmware for FreeBSD drm-kmod"; + platforms = lib.platforms.freebsd; + license = + lib.optional withAmd lib.licenses.unfreeRedistributableFirmware + # Intel license prohibits modification. this will wrap firmware files in an ELF + ++ lib.optional withIntel lib.licenses.unfree; + sourceProvenance = [ lib.sourceTypes.binaryFirmware ]; + }; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/package.nix new file mode 100644 index 0000000000000..42806392d217a --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/package.nix @@ -0,0 +1,53 @@ +{ + lib, + mkDerivation, + fetchFromGitHub, + xargs-j, + versionData, + sys, +}: +let + # Based off ports tree versions + reldate = lib.toIntBase10 versionData.reldate; + branch = + if reldate >= 1500008 then + "6.1-lts" + else if reldate >= 1400097 then + "5.15-lts" + else if reldate >= 1302000 then + "5.10-lts" + else + throw "drm-kmod not supported on FreeBSD version ${reldate}"; + + fetchOptions = (lib.importJSON ./versions.json).${branch}; +in +mkDerivation { + pname = "drm-kmod"; + version = branch; + + src = fetchFromGitHub fetchOptions; + + extraNativeBuildInputs = [ xargs-j ]; + + hardeningDisable = [ + "pic" # generates relocations the linker can't handle + "stackprotector" # generates stack protection for the function generating the stack canary + ]; + + # hardeningDisable = stackprotector doesn't seem to be enough, put it in cflags too + NIX_CFLAGS_COMPILE = "-fno-stack-protector"; + + env = sys.passthru.env; + SYSDIR = "${sys.src}/sys"; + + KMODDIR = "${builtins.placeholder "out"}/kernel"; + + meta = { + description = "Linux drm driver, ported to FreeBSD"; + platforms = lib.platforms.freebsd; + license = with lib.licenses; [ + bsd2 + gpl2Only + ]; + }; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/update.py b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/update.py new file mode 100755 index 0000000000000..c724e3cbd104a --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/update.py @@ -0,0 +1,21 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python -p python3 nix-prefetch-github git + +import subprocess +import json +import os.path + +BRANCHES = ["5.10-lts", "5.15-lts", "6.1-lts"] +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) + +versions = dict() + +for branch in BRANCHES: + text = subprocess.check_output( + ["nix-prefetch-github", "freebsd", "drm-kmod", "--rev", branch, "--json"] + ).decode("utf-8") + versions[branch] = json.loads(text) + +with open(os.path.join(BASE_DIR, "versions.json"), "w") as out: + json.dump(versions, out, sort_keys=True, indent=2) + out.write("\n") diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/versions.json b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/versions.json new file mode 100644 index 0000000000000..9375e53e9d4dd --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/versions.json @@ -0,0 +1,20 @@ +{ + "5.10-lts": { + "hash": "sha256-6v8FhaEch9fJfo0/1UXeo0bcZh5n4Y2TyAsyHmCBJgw=", + "owner": "freebsd", + "repo": "drm-kmod", + "rev": "e7950546196d44af502dd6abf162d1453f6f0dd0" + }, + "5.15-lts": { + "hash": "sha256-i768QfnYo2hqxnoCEnfYqOurDSRwkAsC4qsP7TUalxc=", + "owner": "freebsd", + "repo": "drm-kmod", + "rev": "d7dc64fb8e63208afaca01e6d48284aa2305df35" + }, + "6.1-lts": { + "hash": "sha256-+CsqQ0beJgoO3SSWzwLcAO8JP15oaDW9HR+bxwPaan4=", + "owner": "freebsd", + "repo": "drm-kmod", + "rev": "f2d6d4b58446fa45de575bae76d6435439b3ca8b" + } +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/fdisk.nix b/pkgs/os-specific/bsd/freebsd/pkgs/fdisk.nix new file mode 100644 index 0000000000000..62654008955c4 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/fdisk.nix @@ -0,0 +1,6 @@ +{ mkDerivation, libgeom }: +mkDerivation { + path = "sbin/fdisk"; + + buildInputs = [ libgeom ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/fsck.nix b/pkgs/os-specific/bsd/freebsd/pkgs/fsck.nix new file mode 100644 index 0000000000000..ba55a5f651ed4 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/fsck.nix @@ -0,0 +1,5 @@ +{ mkDerivation }: +mkDerivation { + path = "sbin/fsck"; + extraPaths = [ "sbin/mount" ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/geom.nix b/pkgs/os-specific/bsd/freebsd/pkgs/geom.nix new file mode 100644 index 0000000000000..552d2e420120a --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/geom.nix @@ -0,0 +1,44 @@ +{ + mkDerivation, + libgeom, + libufs, + openssl, +}: +let + libs = mkDerivation { + name = "geom-class-libs"; + path = "lib/geom"; + extraPaths = [ + "lib/Makefile.inc" + "sbin/geom" + "sys/geom" + + # geli isn't okay with just libcrypt, it wants files in here + "sys/crypto/sha2" + "sys/opencrypto" + ]; + + # libgeom needs sbuf and bsdxml but linker doesn't know that + buildInputs = [ + libgeom + libufs + openssl + ]; + + # tools want geom headers but don't seem to declare it + preBuild = '' + export NIX_CFLAGS_COMPILE="-I$BSDSRCDIR/sys $NIX_CFLAGS_COMPILE"; + ''; + }; +in +mkDerivation { + path = "sbin/geom"; + extraPaths = [ + "lib/Makefile.inc" + "lib/geom" + ]; + + GEOM_CLASS_DIR = "${libs}/lib"; + + buildInputs = [ libgeom ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/getent.nix b/pkgs/os-specific/bsd/freebsd/pkgs/getent.nix new file mode 100644 index 0000000000000..4d812f506b4dc --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/getent.nix @@ -0,0 +1 @@ +{ mkDerivation }: mkDerivation { path = "usr.bin/getent"; } diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/getty.nix b/pkgs/os-specific/bsd/freebsd/pkgs/getty.nix new file mode 100644 index 0000000000000..4335a21fe4f3c --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/getty.nix @@ -0,0 +1,21 @@ +{ + mkDerivation, + login, + wrappedLogin ? null, +}: +mkDerivation { + path = "libexec/getty"; + + postPatch = '' + sed -E -i -e "s|/usr/bin/login|${ + if (wrappedLogin != null) then wrappedLogin else "${login}/bin/login" + }|g" $BSDSRCDIR/libexec/getty/*.h + ''; + + MK_TESTS = "no"; + + postInstall = '' + mkdir -p $out/etc + cp $BSDSRCDIR/libexec/getty/gettytab $out/etc/gettytab + ''; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/id.nix b/pkgs/os-specific/bsd/freebsd/pkgs/id.nix new file mode 100644 index 0000000000000..d838995f89bd7 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/id.nix @@ -0,0 +1 @@ +{ mkDerivation }: mkDerivation { path = "usr.bin/id"; } diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/ifconfig.nix b/pkgs/os-specific/bsd/freebsd/pkgs/ifconfig.nix new file mode 100644 index 0000000000000..16b20733af4b3 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/ifconfig.nix @@ -0,0 +1,24 @@ +{ + mkDerivation, + compatIfNeeded, + libifconfig, + lib80211, + libjail, + libnv, +}: +mkDerivation { + path = "sbin/ifconfig"; + + buildInputs = compatIfNeeded ++ [ + libifconfig + lib80211 + libjail + libnv + ]; + + # ifconfig believes libifconfig is internal and thus PIE. + # We build libifconfig as an external library + MK_PIE = "no"; + + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/init.nix b/pkgs/os-specific/bsd/freebsd/pkgs/init.nix new file mode 100644 index 0000000000000..502c532b82e8d --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/init.nix @@ -0,0 +1,7 @@ +{ mkDerivation }: +mkDerivation { + path = "sbin/init"; + extraPaths = [ "sbin/mount" ]; + NO_FSCHG = "yes"; + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/kldconfig.nix b/pkgs/os-specific/bsd/freebsd/pkgs/kldconfig.nix new file mode 100644 index 0000000000000..29f2a1b54308f --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/kldconfig.nix @@ -0,0 +1,6 @@ +{ mkDerivation, lib }: +mkDerivation { + path = "sbin/kldconfig"; + + meta.platforms = lib.platforms.freebsd; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/kldload.nix b/pkgs/os-specific/bsd/freebsd/pkgs/kldload.nix new file mode 100644 index 0000000000000..a39909dc03692 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/kldload.nix @@ -0,0 +1,6 @@ +{ mkDerivation, lib }: +mkDerivation { + path = "sbin/kldload"; + + meta.platforms = lib.platforms.freebsd; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/kldstat.nix b/pkgs/os-specific/bsd/freebsd/pkgs/kldstat.nix new file mode 100644 index 0000000000000..164376a6bff90 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/kldstat.nix @@ -0,0 +1,6 @@ +{ mkDerivation, lib }: +mkDerivation { + path = "sbin/kldstat"; + + meta.platforms = lib.platforms.freebsd; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/kldunload.nix b/pkgs/os-specific/bsd/freebsd/pkgs/kldunload.nix new file mode 100644 index 0000000000000..fc622fc9edade --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/kldunload.nix @@ -0,0 +1,6 @@ +{ mkDerivation, lib }: +mkDerivation { + path = "sbin/kldunload"; + + meta.platforms = lib.platforms.freebsd; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/lib80211.nix b/pkgs/os-specific/bsd/freebsd/pkgs/lib80211.nix new file mode 100644 index 0000000000000..1cc8d337e0572 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/lib80211.nix @@ -0,0 +1,13 @@ +{ + mkDerivation, + libsbuf, + libbsdxml, +}: +mkDerivation { + path = "lib/lib80211"; + buildInputs = [ + libsbuf + libbsdxml + ]; + clangFixup = true; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libbsdxml.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libbsdxml.nix new file mode 100644 index 0000000000000..333e4048c8376 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libbsdxml.nix @@ -0,0 +1,6 @@ +{ mkDerivation }: +mkDerivation { + path = "lib/libexpat"; + extraPaths = [ "contrib/expat" ]; + buildInputs = [ ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libbsm.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libbsm.nix new file mode 100644 index 0000000000000..96ec9fd84d383 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libbsm.nix @@ -0,0 +1,7 @@ +{ mkDerivation, libpam }: +mkDerivation { + path = "lib/libbsm"; + extraPaths = [ "contrib/openbsm" ]; + buildInputs = [ libpam ]; + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libgeom.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libgeom.nix new file mode 100644 index 0000000000000..295d9d75c5370 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libgeom.nix @@ -0,0 +1,17 @@ +{ + mkDerivation, + libbsdxml, + libsbuf, +}: +mkDerivation { + path = "lib/libgeom"; + buildInputs = [ + libbsdxml + libsbuf + ]; + + makeFlags = [ + "SHLIB_MAJOR=1" + "STRIP=-s" + ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libifconfig.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libifconfig.nix new file mode 100644 index 0000000000000..4d7ab09b0c00c --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libifconfig.nix @@ -0,0 +1,9 @@ +{ mkDerivation, buildPackages }: +mkDerivation { + path = "lib/libifconfig"; + extraPaths = [ + "tools/lua" + "lib/libc/Versions.def" + ]; + LUA = "${buildPackages.lua}/bin/lua"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libipsec.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libipsec.nix new file mode 100644 index 0000000000000..a250448bac54d --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libipsec.nix @@ -0,0 +1,9 @@ +{ mkDerivation, buildPackages }: +mkDerivation { + path = "lib/libipsec"; + + extraNativeBuildInputs = [ + buildPackages.byacc + buildPackages.flex + ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libkiconv.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libkiconv.nix new file mode 100644 index 0000000000000..543f3e7ac042f --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libkiconv.nix @@ -0,0 +1,5 @@ +{ mkDerivation }: +mkDerivation { + path = "lib/libkiconv"; + extraPaths = [ "sys" ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libpam.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libpam.nix new file mode 100644 index 0000000000000..2afb20377d6bb --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libpam.nix @@ -0,0 +1,44 @@ +{ + mkDerivation, + openssl, + libradius, +}: +mkDerivation { + path = "lib/libpam/libpam"; + extraPaths = [ + "lib/libpam" + "contrib/openpam" + "lib/Makefile.inc" + "contrib/pam_modules" + "crypto/openssh" + ]; + buildInputs = [ + libradius + openssl + ]; + + MK_NIS = "no"; # TODO + + # TODO + postPatch = '' + sed -E -i -e /pam_tacplus/d $BSDSRCDIR/lib/libpam/modules/modules.inc + sed -E -i -e /pam_krb5/d $BSDSRCDIR/lib/libpam/modules/modules.inc + sed -E -i -e /pam_ksu/d $BSDSRCDIR/lib/libpam/modules/modules.inc + sed -E -i -e /pam_ssh/d $BSDSRCDIR/lib/libpam/modules/modules.inc + ''; + + preBuild = '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$BSDSRCDIR/lib/libpam/libpam -DOPENPAM_MODULES_DIRECTORY=\"$out/lib\"" + ''; + + MK_TESTS = "no"; + + postInstall = '' + make $makeFlags installconfig + + export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib" + make -C $BSDSRCDIR/lib/libpam/modules $makeFlags + make -C $BSDSRCDIR/lib/libpam/modules $makeFlags install + make -C $BSDSRCDIR/lib/libpam/modules $makeFlags installconfig + ''; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libradius.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libradius.nix new file mode 100644 index 0000000000000..9766d75e6c3f7 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libradius.nix @@ -0,0 +1,14 @@ +{ + mkDerivation, + openssl, + libmd, +}: +mkDerivation { + path = "lib/libradius"; + buildInputs = [ + libmd + openssl + ]; + + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libsysdecode.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libsysdecode.nix new file mode 100644 index 0000000000000..da78404e2a58f --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libsysdecode.nix @@ -0,0 +1,14 @@ +{ mkDerivation, stdenv }: +mkDerivation { + path = "lib/libsysdecode"; + extraPaths = [ + "sys" + "libexec/rtld-elf" + ]; + + preBuild = '' + sed -E -i -e "s|..INCLUDEDIR.|${stdenv.cc.libc}/include|g" $BSDSRCDIR/lib/libsysdecode/Makefile + ''; + + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libufs.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libufs.nix new file mode 100644 index 0000000000000..c0d71eb2b9c13 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libufs.nix @@ -0,0 +1,8 @@ +{ mkDerivation }: +mkDerivation { + path = "lib/libufs"; + extraPaths = [ + "sys/libkern" + "sys/ufs" + ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libzfs.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libzfs.nix new file mode 100644 index 0000000000000..fcb4b29dc14d6 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libzfs.nix @@ -0,0 +1,85 @@ +{ + mkDerivation, + lib, + libbsdxml, + libgeom, + openssl, + zfs-data, + zlib, +}: +# When I told you this was libzfs, I lied. +# This is actually all the openzfs libs. +# We need to build a bunch of them before libzfs otherwise it complains +# For the dependency tree see sys/contrib/openzfs/lib/Makefile.am +# or cddl/lib/Makefile +let + libs = [ + # Not really "zfs" libraries, they're solaris compatiblity libraries + "libspl" + "libumem" + + # Libraires with no dependencies here execpt libumem and libspl + "libavl" + "libicp" + "libnvpair" + "libtpool" + + # Depend only on the previous ones + "libzutil" + "libzfs_core" + "libuutil" + + # Final libraries + "libzpool" + "libzfs" + ]; +in +mkDerivation { + path = "cddl/lib/libzfs"; + extraPaths = [ + "cddl/Makefile.inc" + "cddl/compat/opensolaris" + "cddl/lib" + "sys/contrib/openzfs" + "sys/modules/zfs" + ]; + + buildInputs = [ + libbsdxml + libgeom + openssl + zlib + ]; + + postPatch = '' + # libnvpair uses `struct xdr_bytesrec`, which is never defined when this is set + # no idea how this works upstream + sed -i 's/-DHAVE_XDR_BYTESREC//' $BSDSRCDIR/cddl/lib/libnvpair/Makefile + + # libzfs wants some files from compatibility.d, put them in the store + sed -i 's|/usr/share/zfs|${zfs-data}/share/zfs|' $BSDSRCDIR/cddl/lib/libzfs/Makefile + ''; + + # If we don't specify an object directory then + # make will try to put openzfs objects in nonexistant directories. + # This one seems to work + preBuild = + '' + export MAKEOBJDIRPREFIX=$BSDSRCDIR/obj + '' + + lib.flip lib.concatMapStrings libs (libname: '' + echo "building dependency ${libname}" + make -C $BSDSRCDIR/cddl/lib/${libname} $makeFlags + make -C $BSDSRCDIR/cddl/lib/${libname} $makeFlags install + ''); + + outputs = [ + "out" + "debug" + ]; + + meta = { + platforms = lib.platforms.freebsd; + license = with lib.licenses; [ cddl ]; + }; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/limits.nix b/pkgs/os-specific/bsd/freebsd/pkgs/limits.nix new file mode 100644 index 0000000000000..1e045c8a13fae --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/limits.nix @@ -0,0 +1,6 @@ +{ mkDerivation, libutil }: +mkDerivation { + path = "usr.bin/limits"; + buildInputs = [ libutil ]; + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/login.nix b/pkgs/os-specific/bsd/freebsd/pkgs/login.nix new file mode 100644 index 0000000000000..8952068b8e9c1 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/login.nix @@ -0,0 +1,28 @@ +{ + mkDerivation, + libutil, + libpam, + libbsm, + cap_mkdb, +}: +mkDerivation { + path = "usr.bin/login"; + buildInputs = [ + libutil + libpam + libbsm + ]; + extraNativeBuildInputs = [ cap_mkdb ]; + + postPatch = '' + sed -E -i -e "s|..DESTDIR./etc|\''${CONFDIR}|g" $BSDSRCDIR/usr.bin/login/Makefile + ''; + + MK_TESTS = "no"; + MK_SETUID_LOGIN = "no"; + + postInstall = '' + mkdir -p $out/etc + make $makeFlags installconfig + ''; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/makefs.nix b/pkgs/os-specific/bsd/freebsd/pkgs/makefs.nix new file mode 100644 index 0000000000000..c685a84264b7a --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/makefs.nix @@ -0,0 +1,24 @@ +{ + mkDerivation, + libnetbsd, + compatIfNeeded, + libsbuf, +}: +mkDerivation { + path = "usr.sbin/makefs"; + extraPaths = [ + "stand/libsa" + "sys/cddl/boot" + "sys/ufs/ffs" + "sbin/newfs_msdos" + "contrib/mtree" + "contrib/mknod" + "sys/fs/cd9660" + ]; + buildInputs = compatIfNeeded ++ [ + libnetbsd + libsbuf + ]; + MK_TESTS = "no"; + MK_PIE = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mdconfig.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mdconfig.nix new file mode 100644 index 0000000000000..b5e13344d94ac --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mdconfig.nix @@ -0,0 +1,7 @@ +{ mkDerivation, libgeom }: +mkDerivation { + path = "sbin/mdconfig"; + buildInputs = [ libgeom ]; + + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix index a085367ac68e6..ec4b698116b9c 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix @@ -2,9 +2,6 @@ lib, stdenv, stdenvNoCC, - stdenvNoLibs, - overrideCC, - buildPackages, versionData, writeText, patches, @@ -24,15 +21,7 @@ lib.makeOverridable ( attrs: let - stdenv' = - if attrs.noCC or false then - stdenvNoCC - else if attrs.noLibc or false then - stdenvNoLibs - else if attrs.noLibcxx or false then - overrideCC stdenv buildPackages.llvmPackages.clangNoLibcxx - else - stdenv; + stdenv' = if attrs.noCC or false then stdenvNoCC else stdenv; in stdenv'.mkDerivation ( rec { @@ -117,61 +106,10 @@ lib.makeOverridable ( } // { patches = - let - isDir = - file: - let - base = baseNameOf file; - type = (builtins.readDir (dirOf file)).${base} or null; - in - file == /. || type == "directory"; - consolidatePatches = - patches: - if (lib.isDerivation patches) then - [ patches ] - else if (builtins.isPath patches) then - (if (isDir patches) then (lib.filesystem.listFilesRecursive patches) else [ patches ]) - else if (builtins.isList patches) then - (lib.flatten (builtins.map consolidatePatches patches)) - else - throw "Bad patches - must be path or derivation or list thereof"; - consolidated = consolidatePatches patches; - splitPatch = - patchFile: - let - allLines' = lib.strings.splitString "\n" (builtins.readFile patchFile); - allLines = builtins.filter ( - line: !((lib.strings.hasPrefix "diff --git" line) || (lib.strings.hasPrefix "index " line)) - ) allLines'; - foldFunc = - a: b: - if ((lib.strings.hasPrefix "--- " b) || (lib.strings.hasPrefix "diff --git " b)) then - (a ++ [ [ b ] ]) - else - ((lib.lists.init a) ++ (lib.lists.singleton ((lib.lists.last a) ++ [ b ]))); - partitionedPatches' = lib.lists.foldl foldFunc [ [ ] ] allLines; - partitionedPatches = - if (builtins.length partitionedPatches' > 1) then - (lib.lists.drop 1 partitionedPatches') - else - (throw "${patchFile} does not seem to be a unified patch (diff -u). this is required for FreeBSD."); - filterFunc = - patchLines: - let - prefixedPath = builtins.elemAt (builtins.split " |\t" (builtins.elemAt patchLines 1)) 2; - unfixedPath = lib.path.subpath.join (lib.lists.drop 1 (lib.path.subpath.components prefixedPath)); - in - lib.lists.any (included: lib.path.hasPrefix (/. + ("/" + included)) (/. + ("/" + unfixedPath))) ( - (attrs.extraPaths or [ ]) ++ [ attrs.path ] - ); - filteredLines = builtins.filter filterFunc partitionedPatches; - derive = patchLines: writeText "freebsd-patch" (lib.concatLines patchLines); - derivedPatches = builtins.map derive filteredLines; - in - derivedPatches; - picked = lib.lists.concatMap splitPatch consolidated; - in - picked ++ attrs.patches or [ ]; + (lib.optionals (attrs.autoPickPatches or true) ( + freebsd-lib.filterPatches patches (attrs.extraPaths or [ ] ++ [ attrs.path ]) + )) + ++ attrs.patches or [ ]; } ) ) diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mkimg.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mkimg.nix new file mode 100644 index 0000000000000..00982a2a52a74 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mkimg.nix @@ -0,0 +1,6 @@ +{ mkDerivation }: +mkDerivation { + path = "usr.bin/mkimg"; + extraPaths = [ "sys/sys/disk" ]; + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mount.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mount.nix new file mode 100644 index 0000000000000..a4885871ad1c5 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mount.nix @@ -0,0 +1,13 @@ +{ + mkDerivation, + libutil, + libxo, + ... +}: +mkDerivation { + path = "sbin/mount"; + buildInputs = [ + libutil + libxo + ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mount_msdosfs.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mount_msdosfs.nix new file mode 100644 index 0000000000000..da42260ffbad5 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mount_msdosfs.nix @@ -0,0 +1,6 @@ +{ mkDerivation, libkiconv }: +mkDerivation { + path = "sbin/mount_msdosfs"; + extraPaths = [ "sbin/mount" ]; + buildInputs = [ libkiconv ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/newfs.nix b/pkgs/os-specific/bsd/freebsd/pkgs/newfs.nix new file mode 100644 index 0000000000000..7b7af7fcb25f8 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/newfs.nix @@ -0,0 +1,6 @@ +{ mkDerivation, libufs }: +mkDerivation { + path = "sbin/newfs"; + extraPaths = [ "sys/geom" ]; + buildInputs = [ libufs ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/newfs_msdos.nix b/pkgs/os-specific/bsd/freebsd/pkgs/newfs_msdos.nix new file mode 100644 index 0000000000000..274421a1a0966 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/newfs_msdos.nix @@ -0,0 +1,6 @@ +{ mkDerivation }: +mkDerivation { + path = "sbin/newfs_msdos"; + + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/newsyslog.nix b/pkgs/os-specific/bsd/freebsd/pkgs/newsyslog.nix new file mode 100644 index 0000000000000..947f324587ba5 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/newsyslog.nix @@ -0,0 +1,15 @@ +{ + mkDerivation, + compatIfNeeded, + libsbuf, +}: +mkDerivation { + path = "usr.sbin/newsyslog"; + + buildInputs = compatIfNeeded ++ [ libsbuf ]; + + # The only subdir is newsyslog.conf.d, all config files we don't want + postPatch = '' + sed -E -i -e '/^SUBDIR/d' $BSDSRCDIR/usr.sbin/newsyslog/Makefile + ''; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/nscd.nix b/pkgs/os-specific/bsd/freebsd/pkgs/nscd.nix new file mode 100644 index 0000000000000..c3ae6d46f0675 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/nscd.nix @@ -0,0 +1,5 @@ +{ mkDerivation, libutil, ... }: +mkDerivation { + path = "usr.sbin/nscd"; + buildInputs = [ libutil ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/ping.nix b/pkgs/os-specific/bsd/freebsd/pkgs/ping.nix new file mode 100644 index 0000000000000..ea209db2b960d --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/ping.nix @@ -0,0 +1,24 @@ +{ + mkDerivation, + lib, + libcasper, + libcapsicum, + libipsec, +}: +mkDerivation { + path = "sbin/ping"; + buildInputs = [ + libcasper + libcapsicum + libipsec + ]; + + postPatch = '' + sed -i 's/4555/0555/' $BSDSRCDIR/sbin/ping/Makefile + ''; + + MK_TESTS = "no"; + clangFixup = true; + + meta.platforms = lib.platforms.freebsd; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/protect.nix b/pkgs/os-specific/bsd/freebsd/pkgs/protect.nix new file mode 100644 index 0000000000000..00e5dcfb16e94 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/protect.nix @@ -0,0 +1 @@ +{ mkDerivation }: mkDerivation { path = "usr.bin/protect"; } diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/pwd_mkdb.nix b/pkgs/os-specific/bsd/freebsd/pkgs/pwd_mkdb.nix new file mode 100644 index 0000000000000..27c3a9cec42ac --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/pwd_mkdb.nix @@ -0,0 +1,6 @@ +{ mkDerivation, ... }: +mkDerivation { + path = "usr.sbin/pwd_mkdb"; + + extraPaths = [ "lib/libc/gen" ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/rc.nix b/pkgs/os-specific/bsd/freebsd/pkgs/rc.nix new file mode 100644 index 0000000000000..92b645851b9c1 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/rc.nix @@ -0,0 +1,76 @@ +{ + mkDerivation, + lib, + sysctl, + bash, + rcorder, + bin, + stat, + id, + protect, + mount, +}: +let + rcDepsPath = lib.makeBinPath [ + sysctl + bin + bash + rcorder + stat + id + mount + protect + ]; +in +mkDerivation { + path = "libexec/rc"; + MK_TESTS = "no"; + + postPatch = + '' + substituteInPlace "$BSDSRCDIR/libexec/rc/rc.d/Makefile" "$BSDSRCDIR/libexec/rc/Makefile" --replace-fail /etc $out/etc + substituteInPlace "$BSDSRCDIR/libexec/rc/rc.d/Makefile" --replace-fail /var $out/var + '' + + ( + let + bins = [ + "/sbin/sysctl" + "/usr/bin/protect" + "/usr/bin/id" + "/bin/ps" + "/bin/cpuset" + "/usr/bin/stat" + "/bin/rm" + "/bin/chmod" + "/bin/cat" + "/bin/sync" + "/bin/sleep" + "/bin/date" + ]; + scripts = [ + "rc" + "rc.initdiskless" + "rc.shutdown" + "rc.subr" + "rc.suspend" + "rc.resume" + ]; + scriptPaths = "$BSDSRCDIR/libexec/rc/{${lib.concatStringsSep "," scripts}}"; + in + # set PATH correctly in scripts + '' + sed -E -i -e "s|PATH=.*|PATH=${rcDepsPath}|g" ${scriptPaths} + '' + # replace executable absolute filepaths with PATH lookups + + lib.concatMapStringsSep "\n" (fname: '' + sed -E -i -e "s|${fname}|${lib.last (lib.splitString "/" fname)}|g" \ + ${scriptPaths}'') bins + ); + + skipIncludesPhase = true; + + postInstall = '' + makeFlags="$(sed -E -e 's/CONFDIR=[^ ]*//g' <<<"$makeFlags")" + make $makeFlags installconfig + ''; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/rcorder.nix b/pkgs/os-specific/bsd/freebsd/pkgs/rcorder.nix new file mode 100644 index 0000000000000..ddacf18e7b95e --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/rcorder.nix @@ -0,0 +1 @@ +{ mkDerivation }: mkDerivation { path = "sbin/rcorder"; } diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/reboot.nix b/pkgs/os-specific/bsd/freebsd/pkgs/reboot.nix new file mode 100644 index 0000000000000..10a042dc45fde --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/reboot.nix @@ -0,0 +1,6 @@ +{ mkDerivation }: +mkDerivation { + path = "sbin/reboot"; + + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/route.nix b/pkgs/os-specific/bsd/freebsd/pkgs/route.nix new file mode 100644 index 0000000000000..83278e7857971 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/route.nix @@ -0,0 +1,10 @@ +{ + mkDerivation, + compatIfNeeded, + libjail, +}: +mkDerivation { + path = "sbin/route"; + buildInputs = compatIfNeeded ++ [ libjail ]; + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/services_mkdb.nix b/pkgs/os-specific/bsd/freebsd/pkgs/services_mkdb.nix new file mode 100644 index 0000000000000..33c07093260ef --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/services_mkdb.nix @@ -0,0 +1,8 @@ +{ mkDerivation }: +mkDerivation { + path = "usr.sbin/services_mkdb"; + postInstall = '' + mkdir -p $out/etc + cp $BSDSRCDIR/usr.sbin/services_mkdb/services $out/etc/services + ''; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/shutdown.nix b/pkgs/os-specific/bsd/freebsd/pkgs/shutdown.nix new file mode 100644 index 0000000000000..4d32db0ed1da4 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/shutdown.nix @@ -0,0 +1,9 @@ +{ mkDerivation }: +mkDerivation { + path = "sbin/shutdown"; + + MK_TESTS = "no"; + preBuild = '' + sed -i 's/4554/0554/' Makefile + ''; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/stand-efi.nix b/pkgs/os-specific/bsd/freebsd/pkgs/stand-efi.nix new file mode 100644 index 0000000000000..c2d42af7814a4 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/stand-efi.nix @@ -0,0 +1,60 @@ +{ + lib, + stdenv, + mkDerivation, + include, + buildPackages, + freebsd-lib, + vtfontcvt, +}: +let + hostArchBsd = freebsd-lib.mkBsdArch stdenv; +in +mkDerivation { + path = "stand/efi"; + extraPaths = [ + "contrib/bzip2" + "contrib/llvm-project/compiler-rt/lib/builtins" + "contrib/lua" + "contrib/pnglite" + "contrib/terminus" + "lib/libc" + "lib/liblua" + "libexec/flua" + "stand" + "sys" + ]; + extraNativeBuildInputs = [ vtfontcvt ]; + + makeFlags = [ + "STRIP=-s" # flag to install, not command + "MK_MAN=no" + "MK_TESTS=no" + "OBJCOPY=${lib.getBin buildPackages.binutils-unwrapped}/bin/${buildPackages.binutils-unwrapped.targetPrefix}objcopy" + ] ++ lib.optional (!stdenv.hostPlatform.isFreeBSD) "MK_WERROR=no"; + + hardeningDisable = [ "stackprotector" ]; + + # ??? + preBuild = '' + NIX_CFLAGS_COMPILE+=" -I${include}/include -I$BSDSRCDIR/sys/sys -I$BSDSRCDIR/sys/${hostArchBsd}/include" + export NIX_CFLAGS_COMPILE + + make -C $BSDSRCDIR/stand/libsa $makeFlags + make -C $BSDSRCDIR/stand/ficl $makeFlags + make -C $BSDSRCDIR/stand/liblua $makeFlags + ''; + + postPatch = '' + sed -E -i -e 's|/bin/pwd|${buildPackages.coreutils}/bin/pwd|' $BSDSRCDIR/stand/defs.mk + #sed -E -i -e 's|-e start|-Wl,-e,start|g' $BSDSRCDIR/stand/i386/Makefile.inc $BSDSRCDIR/stand/i386/*/Makefile + ''; + + postInstall = '' + mkdir -p $out/bin/lua + cp $BSDSRCDIR/stand/lua/*.lua $out/bin/lua + cp -r $BSDSRCDIR/stand/defaults $out/bin/defaults + ''; + + meta.platforms = lib.platforms.freebsd; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/stat.nix b/pkgs/os-specific/bsd/freebsd/pkgs/stat.nix index a801ab895441c..78c01ae498bd3 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/stat.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/stat.nix @@ -19,4 +19,6 @@ mkDerivation { mandoc groff ]; + + MK_TESTS = "no"; } diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/swapon.nix b/pkgs/os-specific/bsd/freebsd/pkgs/swapon.nix new file mode 100644 index 0000000000000..d7bd8a870b8f4 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/swapon.nix @@ -0,0 +1 @@ +{ mkDerivation }: mkDerivation { path = "sbin/swapon"; } diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix index 86f847cbd45cf..5bca92269212f 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix @@ -1,85 +1,137 @@ { - stdenv, + lib, mkDerivation, - freebsd-lib, + stdenv, buildPackages, + freebsd-lib, + patches, + filterSource, + applyPatches, + baseConfig ? "GENERIC", + extraFlags ? { }, bsdSetupHook, + mandoc, + groff, + gawk, freebsdSetupHook, makeMinimal, install, - mandoc, - groff, config, rpcgen, file2c, - gawk, - uudecode, + bintrans, xargs-j, }: - -mkDerivation ( - let - cfg = "MINIMAL"; - in - rec { +let + hostArchBsd = freebsd-lib.mkBsdArch stdenv; + filteredSource = filterSource { + pname = "sys"; path = "sys"; - - nativeBuildInputs = [ - bsdSetupHook - freebsdSetupHook - makeMinimal - install - mandoc - groff - - config - rpcgen - file2c - gawk - uudecode - xargs-j + extraPaths = [ "include" ]; + }; + patchedSource = applyPatches { + src = filteredSource; + patches = freebsd-lib.filterPatches patches [ + "sys" + "include" ]; + postPatch = '' + for f in sys/conf/kmod.mk sys/contrib/dev/acpica/acpica_prep.sh; do + substituteInPlace "$f" --replace-warn 'xargs -J' 'xargs-j ' + done + + for f in sys/conf/*.mk; do + substituteInPlace "$f" --replace-quiet 'KERN_DEBUGDIR}''${' 'KERN_DEBUGDIR_' + done - # --dynamic-linker /red/herring is used when building the kernel. - NIX_ENFORCE_PURITY = 0; + sed -i sys/${hostArchBsd}/conf/${baseConfig} \ + -e 's/WITH_CTF=1/WITH_CTF=0/' \ + -e '/KDTRACE/d' + ''; + }; - AWK = "${buildPackages.gawk}/bin/awk"; + # Kernel modules need this for kern.opts.mk + env = + { + MK_CTF = "no"; + } + // (lib.flip lib.mapAttrs' extraFlags ( + name: value: { + name = "MK_${lib.toUpper name}"; + value = if value then "yes" else "no"; + } + )); +in +mkDerivation rec { + pname = "sys"; - CWARNEXTRA = "-Wno-error=shift-negative-value -Wno-address-of-packed-member"; + # Patch source outside of this derivation so out-of-tree modules can use it + src = patchedSource; + path = "sys"; + autoPickPatches = false; - MK_CTF = "no"; + nativeBuildInputs = [ + bsdSetupHook + mandoc + groff + gawk + freebsdSetupHook + makeMinimal + install + config + rpcgen + file2c + bintrans + xargs-j + ]; - KODIR = "${builtins.placeholder "out"}/kernel"; - KMODDIR = "${builtins.placeholder "out"}/kernel"; - DTBDIR = "${builtins.placeholder "out"}/dbt"; + # --dynamic-linker /red/herring is used when building the kernel. + NIX_ENFORCE_PURITY = 0; - KERN_DEBUGDIR = "${builtins.placeholder "out"}/debug"; - KERN_DEBUGDIR_KODIR = "${KERN_DEBUGDIR}/kernel"; - KERN_DEBUGDIR_KMODDIR = "${KERN_DEBUGDIR}/kernel"; + AWK = "${buildPackages.gawk}/bin/awk"; - skipIncludesPhase = true; + CWARNEXTRA = "-Wno-error=shift-negative-value -Wno-address-of-packed-member"; - configurePhase = '' - runHook preConfigure + hardeningDisable = [ + "pic" # generates relocations the linker can't handle + "stackprotector" # generates stack protection for the function generating the stack canary + ]; - for f in conf/kmod.mk contrib/dev/acpica/acpica_prep.sh; do - substituteInPlace "$f" --replace 'xargs -J' 'xargs-j ' - done + # hardeningDisable = stackprotector doesn't seem to be enough, put it in cflags too + NIX_CFLAGS_COMPILE = "-fno-stack-protector"; - for f in conf/*.mk; do - substituteInPlace "$f" --replace 'KERN_DEBUGDIR}''${' 'KERN_DEBUGDIR_' - done + inherit env; + passthru.env = env; - cd ${freebsd-lib.mkBsdArch stdenv}/conf - sed -i ${cfg} \ - -e 's/WITH_CTF=1/WITH_CTF=0/' \ - -e '/KDTRACE/d' - config ${cfg} + KODIR = "${builtins.placeholder "out"}/kernel"; + KMODDIR = "${builtins.placeholder "out"}/kernel"; + DTBDIR = "${builtins.placeholder "out"}/dbt"; - runHook postConfigure - ''; - preBuild = '' - cd ../compile/${cfg} - ''; - } -) + KERN_DEBUGDIR = "${builtins.placeholder "debug"}/lib/debug"; + KERN_DEBUGDIR_KODIR = "${KERN_DEBUGDIR}/kernel"; + KERN_DEBUGDIR_KMODDIR = "${KERN_DEBUGDIR}/kernel"; + + skipIncludesPhase = true; + + configurePhase = '' + runHook preConfigure + + cd ${hostArchBsd}/conf + config ${baseConfig} + + runHook postConfigure + ''; + preBuild = '' + cd ../compile/${baseConfig} + ''; + + outputs = [ + "out" + "debug" + ]; + + meta = { + description = "FreeBSD kernel and modules"; + platforms = lib.platforms.freebsd; + }; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/sysctl.nix b/pkgs/os-specific/bsd/freebsd/pkgs/sysctl.nix new file mode 100644 index 0000000000000..42b956614c510 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/sysctl.nix @@ -0,0 +1,5 @@ +{ mkDerivation, ... }: +mkDerivation { + path = "sbin/sysctl"; + MK_TESTS = "no"; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/syslogd.nix b/pkgs/os-specific/bsd/freebsd/pkgs/syslogd.nix new file mode 100644 index 0000000000000..33b7acdf9800c --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/syslogd.nix @@ -0,0 +1,23 @@ +{ mkDerivation, lib }: +mkDerivation { + path = "usr.sbin/syslogd"; + + extraPaths = [ + "usr.bin/wall" + "sys/sys" + ]; + + # These want to install some config files which we don't want + MK_FTP = "no"; + MK_LPR = "no"; + MK_PPP = "no"; + + MK_TESTS = "no"; + + meta = { + description = "FreeBSD syslog daemon"; + maintainers = with lib.maintainers; [ artemist ]; + platforms = lib.platforms.freebsd; + license = lib.licenses.bsd2; + }; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/top.nix b/pkgs/os-specific/bsd/freebsd/pkgs/top.nix new file mode 100644 index 0000000000000..0059fb731d2dd --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/top.nix @@ -0,0 +1,17 @@ +{ + mkDerivation, + libjail, + libncurses-tinfo, + libutil, + libsbuf, + ... +}: +mkDerivation { + path = "usr.bin/top"; + buildInputs = [ + libjail + libncurses-tinfo + libutil + libsbuf + ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/truss.nix b/pkgs/os-specific/bsd/freebsd/pkgs/truss.nix new file mode 100644 index 0000000000000..df00db4367bd9 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/truss.nix @@ -0,0 +1,5 @@ +{ mkDerivation, libsysdecode }: +mkDerivation { + path = "usr.bin/truss"; + buildInputs = [ libsysdecode ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/vtfontcvt.nix b/pkgs/os-specific/bsd/freebsd/pkgs/vtfontcvt.nix new file mode 100644 index 0000000000000..a0ea69b3fd4d1 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/vtfontcvt.nix @@ -0,0 +1,5 @@ +{ mkDerivation }: +mkDerivation { + path = "usr.bin/vtfontcvt"; + extraPaths = [ "sys/cddl/contrib/opensolaris/common/lz4" ]; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/zfs-data.nix b/pkgs/os-specific/bsd/freebsd/pkgs/zfs-data.nix new file mode 100644 index 0000000000000..8b13f7ba9d767 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/zfs-data.nix @@ -0,0 +1,9 @@ +{ mkDerivation, lib }: +mkDerivation { + path = "cddl/share/zfs/compatibility.d"; + extraPaths = [ "sys/contrib/openzfs/cmd/zpool/compatibility.d" ]; + + meta = with lib; { + license = licenses.cddl; + }; +} diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/zfs.nix b/pkgs/os-specific/bsd/freebsd/pkgs/zfs.nix new file mode 100644 index 0000000000000..505fa37fe2d7b --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/pkgs/zfs.nix @@ -0,0 +1,49 @@ +{ + mkDerivation, + lib, + libgeom, + libjail, + libzfs, + openssl, + zfs-data, +}: +mkDerivation { + path = "cddl/sbin/zfs"; + extraPaths = [ + "cddl/compat/opensolaris" + "cddl/sbin/zpool" + "sys/contrib/openzfs" + "sys/modules/zfs" + ]; + + buildInputs = [ + libgeom + libjail + libzfs + openssl + ]; + + postPatch = '' + sed -i 's|/usr/share/zfs|${zfs-data}/share/zfs|' $BSDSRCDIR/cddl/sbin/zpool/Makefile + ''; + + # I lied, this is both zpool and zfs + preBuild = '' + make -C $BSDSRCDIR/cddl/sbin/zpool $makeFlags + make -C $BSDSRCDIR/cddl/sbin/zpool $makeFlags install + ''; + + outputs = [ + "out" + "man" + "debug" + ]; + + meta = { + platforms = lib.platforms.freebsd; + license = with lib.licenses; [ + cddl + bsd2 + ]; + }; +} diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index eeccd0fa07eab..e288e6d216867 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -40,8 +40,10 @@ makeScopeWithSplicing' { stdenvLibcMinimal = crossLibcStdenv.override (old: { cc = old.cc.override { libc = self.libcMinimal; + noLibc = false; bintools = old.cc.bintools.override { libc = self.libcMinimal; + noLibc = false; sharedLibraryLoader = null; }; }; @@ -98,7 +100,7 @@ makeScopeWithSplicing' { inherit (buildNetbsd) makeMinimal; }; - libcMinimal = self.callPackage ./pkgs/libcMinimal.nix { + libcMinimal = self.callPackage ./pkgs/libcMinimal/package.nix { inherit (self) headers csu; inherit (buildNetbsd) netbsdSetupHook diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal/0001-Allow-building-libc-without-generating-tags.patch b/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal/0001-Allow-building-libc-without-generating-tags.patch new file mode 100644 index 0000000000000..0c13f650ceba0 --- /dev/null +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal/0001-Allow-building-libc-without-generating-tags.patch @@ -0,0 +1,53 @@ +From 62acd447e36d5009d3008e025df72c08690905d5 Mon Sep 17 00:00:00 2001 +From: John Ericson <John.Ericson@Obsidian.Systems> +Date: Thu, 20 Jun 2024 15:48:54 -0400 +Subject: [PATCH] Allow building libc without generating tags + +When bootstrapping from scratch, it is nice to avoid dependencies (like +`ctags`/`genassym`/etc.) that are not strictly needed. + +This makefile change introduces a new `MK_LIBC_TAGS` variable, defaulted +to `yes`, to control whether `make all` / `make install` should +build/install (respectively) the tags. + +The underlying rules for tags can still be run regardless of the choice +of variable. +--- + lib/libc/Makefile | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/lib/libc/Makefile b/lib/libc/Makefile +index f2dab2a090e7..c6aa5e45f959 100644 +--- a/lib/libc/Makefile ++++ b/lib/libc/Makefile +@@ -132,7 +132,12 @@ MKREPRO_SED= -e 's;${NETBSDSRCDIR:C/${REGEX_SPECIALS}/\\\\&/g};/usr/src;' + .endif + + .if !defined(MLIBDIR) && ${RUMPRUN} != "yes" ++realall: ${SRCS} ++ ++.if ${MK_LIBC_TAGS:Uyes} == "yes" + realall: tags ++.endif ++ + tags: ${SRCS} + ${_MKTARGET_CREATE} + -${TOOL_CTAGS} -f ${.TARGET}.tmp -w ${.ALLSRC:M*.c} +@@ -146,11 +151,14 @@ tags: ${SRCS} + .endif + rm -f ${.TARGET}.tmp + ++.if ${MK_LIBC_TAGS:Uyes} == "yes" + FILES= tags + FILESNAME= libc.tags + FILESDIR= /var/db + .endif + ++.endif ++ + + # workaround for I18N stuffs: build singlebyte setlocale() for libc.a, + # multibyte for libc.so. the quirk should be removed when we support +-- +2.42.0 + diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal/package.nix index bbab20d53d51e..c1ef1744140ed 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal/package.nix @@ -28,7 +28,6 @@ mkDerivation { "out" "dev" "man" - "tags" ]; USE_FORT = "yes"; MKPROFILE = "no"; @@ -39,32 +38,44 @@ mkDerivation { "sys" "external/bsd/jemalloc" ]; + + patches = [ + # https://mail-index.netbsd.org/tech-toolchain/2024/06/24/msg004438.html + # + # The patch is vendored because the archive software inlined my + # attachment so I am not sure how to programmatically download it. + ./0001-Allow-building-libc-without-generating-tags.patch + ]; + nativeBuildInputs = [ bsdSetupHook netbsdSetupHook makeMinimal install + tsort + lorder mandoc groff + statHook flex byacc - genassym gencat - lorder - tsort - statHook - rpcgen ]; + buildInputs = [ headers csu ]; + env.NIX_CFLAGS_COMPILE = "-B${csu}/lib -fcommon"; - meta.platforms = lib.platforms.netbsd; + SHLIBINSTALLDIR = "$(out)/lib"; MKPICINSTALL = "yes"; + MK_LIBC_TAGS = "no"; NLSDIR = "$(out)/share/nls"; + makeFlags = defaultMakeFlags ++ [ "FILESDIR=$(out)/var/db" ]; + postInstall = '' pushd ${headers} find include -type d -exec mkdir -p "$dev/{}" ';' @@ -75,11 +86,11 @@ mkDerivation { find lib -type d -exec mkdir -p "$out/{}" ';' find lib '(' -type f -o -type l ')' -exec cp -pr "{}" "$out/{}" ';' popd - - moveToOutput var/db/libc.tags "$tags" ''; postPatch = '' sed -i 's,/usr\(/include/sys/syscall.h\),${headers}\1,g' lib/lib*/sys/Makefile.inc ''; + + meta.platforms = lib.platforms.netbsd; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/package.nix index 8e0ef5fd1b74e..ad9c9dd2292d2 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/package.nix @@ -2,7 +2,6 @@ lib, stdenvLibcMinimal, mkDerivation, - headers, libcMinimal, librt, }: diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix index c217f6a7ce465..9ebbaa974c570 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libutil.nix @@ -11,7 +11,6 @@ lorder, mandoc, statHook, - headers, }: mkDerivation { diff --git a/pkgs/os-specific/bsd/openbsd/default.nix b/pkgs/os-specific/bsd/openbsd/default.nix index bfc88f097865f..4db2df57bc262 100644 --- a/pkgs/os-specific/bsd/openbsd/default.nix +++ b/pkgs/os-specific/bsd/openbsd/default.nix @@ -1,5 +1,7 @@ { lib, + crossLibcStdenv, + stdenvNoCC, makeScopeWithSplicing', generateSplicesForMkScope, buildPackages, @@ -19,32 +21,71 @@ makeScopeWithSplicing' { directory = ./pkgs; } // { - libc = self.callPackage ./pkgs/libc/package.nix { + version = "7.5"; + + stdenvLibcMinimal = crossLibcStdenv.override (old: { + cc = old.cc.override { + libc = self.libcMinimal; + noLibc = false; + bintools = old.cc.bintools.override { + libc = self.libcMinimal; + noLibc = false; + sharedLibraryLoader = null; + }; + }; + }); + + makeMinimal = buildPackages.netbsd.makeMinimal.override { inherit (self) make-rules; }; + + # The manual callPackages below should in principle be unnecessary, but are + # necessary. See note in ../netbsd/default.nix + + include = self.callPackage ./pkgs/include/package.nix { + inherit (buildOpenbsd) makeMinimal; + inherit (buildPackages.netbsd) install rpcgen mtree; + }; + + csu = self.callPackage ./pkgs/csu.nix { + inherit (self) include; + inherit (buildOpenbsd) makeMinimal; + inherit (buildPackages.netbsd) install; + }; + + libcMinimal = self.callPackage ./pkgs/libcMinimal/package.nix { inherit (self) csu include; inherit (buildOpenbsd) makeMinimal; inherit (buildPackages.netbsd) install gencat + tsort rpcgen + ; + }; + + librpcsvc = self.callPackage ./pkgs/librpcsvc.nix { + inherit (buildOpenbsd) openbsdSetupHook makeMinimal lorder; + inherit (buildPackages.netbsd) + install tsort + statHook + rpcgen ; }; - makeMinimal = buildPackages.netbsd.makeMinimal.override { inherit (self) make-rules; }; + + libutil = self.callPackage ./pkgs/libutil.nix { + inherit (self) libcMinimal; + inherit (buildOpenbsd) openbsdSetupHook makeMinimal lorder; + inherit (buildPackages.netbsd) install tsort statHook; + }; + + lorder = self.callPackage ./pkgs/lorder.nix { inherit (buildPackages.netbsd) install; }; + + make-rules = self.callPackage ./pkgs/make-rules/package.nix { }; + mkDerivation = self.callPackage ./pkgs/mkDerivation.nix { - inherit (buildPackages.netbsd) install; + inherit (buildPackages.netbsd) install tsort; inherit (buildPackages.buildPackages) rsync; }; - include = self.callPackage ./pkgs/include/package.nix { - inherit (buildOpenbsd) makeMinimal; - inherit (buildPackages.netbsd) install rpcgen mtree; - }; - csu = self.callPackage ./pkgs/csu.nix { - inherit (self) include; - inherit (buildOpenbsd) makeMinimal; - inherit (buildPackages.netbsd) install; - }; - make-rules = self.callPackage ./pkgs/make-rules/package.nix { }; - lorder = self.callPackage ./pkgs/lorder.nix { inherit (buildPackages.netbsd) install; }; } ); } diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/libc.nix b/pkgs/os-specific/bsd/openbsd/pkgs/libc.nix new file mode 100644 index 0000000000000..895b82ed53073 --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/libc.nix @@ -0,0 +1,47 @@ +{ + lib, + symlinkJoin, + libcMinimal, + librthread, + libm, + librpcsvc, + libutil, + version, +}: + +symlinkJoin rec { + name = "${pname}-${version}"; + pname = "libc-openbsd"; + inherit version; + + outputs = [ + "out" + "dev" + "man" + ]; + + paths = + lib.concatMap + (p: [ + (lib.getDev p) + (lib.getLib p) + (lib.getMan p) + ]) + [ + libcMinimal + libm + librthread + librpcsvc + libutil + ]; + + postBuild = '' + rm -r "$out/nix-support" + mkdir -p "$man/share/man" + mv "$out/share"/man* "$man/share/man" + rmdir "$out/share" + fixupPhase + ''; + + meta.platforms = lib.platforms.openbsd; +} diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/libc/disable-librebuild.patch b/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/disable-librebuild.patch index 58633861a826f..58633861a826f 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/libc/disable-librebuild.patch +++ b/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/disable-librebuild.patch diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/libc/netbsd-make-to-lower.patch b/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/netbsd-make-to-lower.patch index e8d016ceead5a..e8d016ceead5a 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/libc/netbsd-make-to-lower.patch +++ b/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/netbsd-make-to-lower.patch diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/libc/package.nix b/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/package.nix index 1a6b6d06a1936..d8d6cc398e0de 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/libc/package.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/package.nix @@ -20,18 +20,16 @@ mkDerivation { noLibc = true; - pname = "libc"; path = "lib/libc"; + pname = "libcMinimal-openbsd"; + outputs = [ + "out" + "dev" + "man" + ]; extraPaths = [ "lib/csu/os-note-elf.h" "sys/arch" - - "lib/libm" - "lib/libpthread" - "lib/librpcsvc" - "lib/librpcsvc" - "lib/librthread" - "lib/libutil" ]; patches = [ @@ -48,12 +46,8 @@ mkDerivation { openbsdSetupHook makeMinimal install - flex - byacc - gencat - rpcgen - ctags tsort + gencat ]; buildInputs = [ @@ -73,49 +67,22 @@ mkDerivation { ) "--undefined-version"; makeFlags = [ - "STRIP=-s" # flag to install, not command "COMPILER_VERSION=clang" "LIBC_TAGS=no" ]; postInstall = '' - symlink_so () { - pushd $out/lib - ln -s "lib$1".so.* "lib$1.so" - popd - } - - symlink_so c - pushd ${include} - find . -type d -exec mkdir -p $out/\{} \; - find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \; + find include -type d -exec mkdir -p "$dev/{}" ';' + find include '(' -type f -o -type l ')' -exec cp -pr "{}" "$dev/{}" ';' popd - substituteInPlace $out/include/sys/time.h --replace "defined (_LIBC)" "true" + substituteInPlace "$dev/include/sys/time.h" --replace "defined (_LIBC)" "true" pushd ${csu} - find . -type d -exec mkdir -p $out/\{} \; - find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \; + find lib -type d -exec mkdir -p "$out/{}" ';' + find lib '(' -type f -o -type l ')' -exec cp -pr "{}" "$out/{}" ';' popd - - NIX_CFLAGS_COMPILE+=" -B$out/lib" - NIX_CFLAGS_COMPILE+=" -I$out/include" - NIX_LDFLAGS+=" -L$out/lib" - - make -C $BSDSRCDIR/lib/libm $makeFlags - make -C $BSDSRCDIR/lib/libm $makeFlags install - symlink_so m - - make -C $BSDSRCDIR/lib/librthread $makeFlags - make -C $BSDSRCDIR/lib/librthread $makeFlags install - symlink_so pthread - - make -C $BSDSRCDIR/lib/librpcsvc $makeFlags - make -C $BSDSRCDIR/lib/librpcsvc $makeFlags install - symlink_so rpcsv - - make -C $BSDSRCDIR/lib/libutil $makeFlags - make -C $BSDSRCDIR/lib/libutil $makeFlags install - symlink_so util ''; + + meta.platforms = lib.platforms.openbsd; } diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/libm.nix b/pkgs/os-specific/bsd/openbsd/pkgs/libm.nix new file mode 100644 index 0000000000000..bf7e933a092b9 --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/libm.nix @@ -0,0 +1,16 @@ +{ lib, mkDerivation }: + +mkDerivation { + path = "lib/libm"; + + libcMinimal = true; + + outputs = [ + "out" + "man" + ]; + + extraPaths = [ "sys" ]; + + meta.platforms = lib.platforms.openbsd; +} diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/librpcsvc.nix b/pkgs/os-specific/bsd/openbsd/pkgs/librpcsvc.nix new file mode 100644 index 0000000000000..77783a041894d --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/librpcsvc.nix @@ -0,0 +1,38 @@ +{ + lib, + mkDerivation, + bsdSetupHook, + openbsdSetupHook, + makeMinimal, + install, + tsort, + lorder, + rpcgen, + statHook, +}: + +mkDerivation { + path = "lib/librpcsvc"; + + libcMinimal = true; + + outputs = [ + "out" + "dev" + ]; + + nativeBuildInputs = [ + bsdSetupHook + openbsdSetupHook + makeMinimal + install + tsort + lorder + rpcgen + statHook + ]; + + makeFlags = [ "INCSDIR=$(dev)/include/rpcsvc" ]; + + meta.platforms = lib.platforms.openbsd; +} diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/librthread.nix b/pkgs/os-specific/bsd/openbsd/pkgs/librthread.nix new file mode 100644 index 0000000000000..1d42d55290c39 --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/librthread.nix @@ -0,0 +1,29 @@ +{ + lib, + stdenvLibcMinimal, + mkDerivation, + libcMinimal, +}: + +mkDerivation { + path = "lib/librthread"; + + libcMinimal = true; + + outputs = [ + "out" + "dev" + ]; + + makeFlags = [ "LIBCSRCDIR=../libc" ]; + + env.NIX_CFLAGS_COMPILE = "-Wno-error"; + + extraPaths = [ + "lib/libpthread" + libcMinimal.path + #"sys" + ]; + + meta.platforms = lib.platforms.openbsd; +} diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/libutil.nix b/pkgs/os-specific/bsd/openbsd/pkgs/libutil.nix new file mode 100644 index 0000000000000..627fabe8cf2a3 --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/libutil.nix @@ -0,0 +1,40 @@ +{ + lib, + stdenvLibcMinimal, + mkDerivation, + libcMinimal, + bsdSetupHook, + openbsdSetupHook, + makeMinimal, + byacc, + install, + tsort, + lorder, + mandoc, + statHook, +}: + +mkDerivation { + path = "lib/libutil"; + + libcMinimal = true; + + outputs = [ + "out" + "man" + ]; + + nativeBuildInputs = [ + bsdSetupHook + openbsdSetupHook + makeMinimal + byacc + install + tsort + lorder + mandoc + statHook + ]; + + meta.platforms = lib.platforms.openbsd; +} diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix index 371c6c58b91fb..a238a326f46d5 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix @@ -3,6 +3,7 @@ stdenv, stdenvNoCC, crossLibcStdenv, + stdenvLibcMinimal, runCommand, rsync, source, @@ -10,6 +11,8 @@ openbsdSetupHook, makeMinimal, install, + tsort, + lorder, }: lib.makeOverridable ( @@ -20,6 +23,8 @@ lib.makeOverridable ( stdenvNoCC else if attrs.noLibc or false then crossLibcStdenv + else if attrs.libcMinimal or false then + stdenvLibcMinimal else stdenv; in @@ -46,15 +51,12 @@ lib.makeOverridable ( openbsdSetupHook makeMinimal install + tsort + lorder ]; HOST_SH = stdenv'.shell; - makeFlags = [ - "STRIP=-s" # flag to install, not command - "-B" - ]; - MACHINE_ARCH = { # amd64 not x86_64 for this on unlike NetBSD @@ -85,9 +87,6 @@ lib.makeOverridable ( // lib.optionalAttrs stdenv'.hasCC { # TODO should CC wrapper set this? CPP = "${stdenv'.cc.targetPrefix}cpp"; - - # Since STRIP in `makeFlags` has to be a flag, not the binary itself - STRIPBIN = "${stdenv'.cc.bintools.targetPrefix}strip"; } // lib.optionalAttrs (attrs.headersOnly or false) { installPhase = "includesPhase"; diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/openbsdSetupHook/setup-hook.sh b/pkgs/os-specific/bsd/openbsd/pkgs/openbsdSetupHook/setup-hook.sh index 50e79bc2928a9..c0fee276fea3d 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/openbsdSetupHook/setup-hook.sh +++ b/pkgs/os-specific/bsd/openbsd/pkgs/openbsdSetupHook/setup-hook.sh @@ -17,5 +17,18 @@ setBinownBingrp() { export BINGRP=$(id -g) } +makeOpenBSDUnversionedLinks() { + [[ -d "$out/lib" ]] || return 0 + pushd "$out/lib" + local l + for l in lib*.so.*; do + l="${l//.so.*/}" + [[ ! -f "$l.so" ]] || continue + ln -s "$l".so.* "$l.so" + done + popd +} + preConfigureHooks+=(addOpenBSDMakeFlags) postPatchHooks+=(fixOpenBSDInstallDirs setBinownBingrp) +preFixupHooks+=(makeOpenBSDUnversionedLinks) diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/source.nix b/pkgs/os-specific/bsd/openbsd/pkgs/source.nix index 359c3f2fbc919..a92dfbd2b2216 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/source.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/source.nix @@ -1,8 +1,12 @@ -{ fetchcvs }: +{ + lib, + fetchcvs, + version, +}: fetchcvs { cvsRoot = "anoncvs@anoncvs.fr.openbsd.org/cvs"; module = "src"; - tag = "OPENBSD_7_5"; + tag = "OPENBSD_${lib.replaceStrings [ "." ] [ "_" ] version}-RELEASE"; sha256 = "sha256-hzdATew6h/FQV72SWtg3YvUXdPoGjm2SoUS7m3c3fSU="; } diff --git a/pkgs/os-specific/bsd/setup-hook.sh b/pkgs/os-specific/bsd/setup-hook.sh index f9453708ab5db..bc8d372ca8b86 100644 --- a/pkgs/os-specific/bsd/setup-hook.sh +++ b/pkgs/os-specific/bsd/setup-hook.sh @@ -28,7 +28,6 @@ addMakeFlags() { # Definitions passed to share/mk/*.mk. Should be pretty simple - # eventually maybe move it to a configure script. - export DESTDIR= export USETOOLS=never export NOCLANGERROR=yes export NOGCCERROR=yes diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix index 206f46125b9bf..af37143835c5d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix @@ -59,7 +59,7 @@ appleDerivation' stdenv { (cd $dep/include && find . -name '*.h' | copyHierarchy $out/include) done - (cd ${buildPackages.darwin.cctools.dev}/include/mach-o && find . -name '*.h' | copyHierarchy $out/include/mach-o) + (cd ${lib.getDev buildPackages.darwin.cctools}/include/mach-o && find . -name '*.h' | copyHierarchy $out/include/mach-o) for header in pthread.h pthread_impl.h pthread_spis.h sched.h; do ln -s "$out/include/pthread/$header" "$out/include/$header" @@ -142,7 +142,7 @@ appleDerivation' stdenv { $out/lib substituteInPlace $out/lib/libSystem.B.tbd \ - --replace "/usr/lib/system/" "$out/lib/system/" + --replace-fail "/usr/lib/system/" "$out/lib/system/" ln -s libSystem.B.tbd $out/lib/libSystem.tbd # Set up links to pretend we work like a conventional unix (Apple's design, not mine!) diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index 78c510f7da4cd..ee9a80518acdf 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -1,108 +1,124 @@ -{ lib, stdenv, makeWrapper, binutils-unwrapped, cctools, llvm, clang-unwrapped, dualAs ? false }: - -# Make sure both underlying packages claim to have prepended their binaries -# with the same targetPrefix. -assert binutils-unwrapped.targetPrefix == cctools.targetPrefix; +{ + lib, + stdenvNoCC, + cctools, + clang-unwrapped, + llvm, + llvm-manpages, + makeWrapper, + enableManpages ? stdenvNoCC.targetPlatform == stdenvNoCC.hostPlatform, +}: let - inherit (binutils-unwrapped) targetPrefix; - cmds = [ - "ar" "ranlib" "as" "install_name_tool" - "ld" "strip" "otool" "lipo" "nm" "strings" "size" + inherit (stdenvNoCC) targetPlatform hostPlatform; + targetPrefix = lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; + + llvm_cmds = [ + "addr2line" + "ar" + "c++filt" + "dsymutil" + "nm" + "objcopy" + "objdump" + "otool" + "size" + "strings" + "strip" + ]; + + cctools_cmds = [ "codesign_allocate" + "gprof" + "ranlib" + # Use the cctools versions because the LLVM ones can crash or fail when the cctools ones don’t. + # Revisit when LLVM is updated to LLVM 18 on Darwin. + "lipo" + "install_name_tool" ]; - isCCToolsLLVM = lib.getName cctools == "cctools-llvm"; -in -# TODO: loop over targetPrefixed binaries too -stdenv.mkDerivation { - pname = "${targetPrefix}cctools-binutils-darwin" + lib.optionalString dualAs "-dualas"; + linkManPages = + pkg: source: target: + lib.optionalString enableManpages '' + sourcePath=${pkg}/share/man/man1/${source}.1.gz + targetPath=''${!outputMan}/share/man/man1/${target}.1.gz + + if [ -f "$sourcePath" ]; then + mkdir -p "$(dirname "$targetPath")" + ln -s "$sourcePath" "$targetPath" + fi + ''; +in +stdenvNoCC.mkDerivation { + pname = "${targetPrefix}cctools-binutils-darwin"; inherit (cctools) version; - outputs = [ "out" "man" ]; + + outputs = [ "out" ] ++ lib.optional enableManpages "man"; + + strictDeps = true; + + nativeBuildInputs = [ makeWrapper ]; + buildCommand = '' mkdir -p $out/bin $out/include - ln -s ${binutils-unwrapped.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt - - # We specifically need: - # - ld: binutils doesn't provide it on darwin - # - as: as above - # - ar: the binutils one produces .a files that the cctools ld doesn't like - # - ranlib: for compatibility with ar - # - otool: we use it for some of our name mangling - # - install_name_tool: we use it to rewrite stuff in our bootstrap tools - # - strip: the binutils one seems to break mach-o files - # - lipo: gcc build assumes it exists - # - nm: the gnu one doesn't understand many new load commands - for i in ${lib.concatStringsSep " " (map (e: targetPrefix + e) cmds)}; do - ln -sf "${cctools}/bin/$i" "$out/bin/$i" - done + for tool in ${toString llvm_cmds}; do + # Translate between LLVM and traditional tool names (e.g., `c++filt` versus `cxxfilt`). + cctoolsTool=''${tool//-/_} + llvmTool=''${tool//++/xx} - ln -s ${llvm}/bin/dsymutil $out/bin/dsymutil + # Some tools aren’t prefixed (like `dsymutil`). + llvmPath="${lib.getBin llvm}/bin" + if [ -e "$llvmPath/llvm-$llvmTool" ]; then + llvmTool=llvm-$llvmTool + elif [ -e "$llvmPath/${targetPrefix}$llvmTool" ]; then + llvmTool=${targetPrefix}$llvmTool + fi - ln -s ${binutils-unwrapped.out}/share $out/share + # Not all tools are included in the bootstrap tools. Don’t link them if they don’t exist. + if [ -e "$llvmPath/$llvmTool" ]; then + ln -s "$llvmPath/$llvmTool" "$out/bin/${targetPrefix}$cctoolsTool" + fi + ${linkManPages llvm-manpages "$llvmTool" "$cctoolsTool"} + done - mkdir -p "$man"/share/man/man{1,5} - for i in ${lib.concatStringsSep " " cmds}; do - for path in "${cctools.man}"/share/man/man?/$i.*; do - dest_path="$man''${path#${cctools.man}}" - ln -sv "$path" "$dest_path" - done + for tool in ${toString cctools_cmds}; do + toolsrc="${lib.getBin cctools}/bin/${targetPrefix}$tool" + if [ -e "$toolsrc" ]; then + ln -s "${lib.getBin cctools}/bin/${targetPrefix}$tool" "$out/bin/${targetPrefix}$tool" + fi + ${linkManPages (lib.getMan cctools) "$tool" "$tool"} done - '' - + lib.optionalString (!isCCToolsLLVM) ( - # cctools-port has a `libexec` folder for `as`, but cctools-llvm uses the clang - # assembler on both platforms. Only link it when cctools is cctools-port. - '' - ln -s ${cctools}/libexec $out/libexec - '' - # cctools-llvm uses the LLVM assembler on both architectures, so use the assembler - # from that instead of relinking it. - # - # On aarch64-darwin we must use clang, because "as" from cctools just doesn't - # handle the arch. Proxying calls to clang produces quite a bit of warnings, - # and using clang directly here is a better option than relying on cctools. - # On x86_64-darwin the Clang version is too old to support this mode. - + lib.optionalString stdenv.isAarch64 '' - rm $out/bin/${targetPrefix}as - makeWrapper "${clang-unwrapped}/bin/clang" "$out/bin/${targetPrefix}as" \ - --add-flags "-x assembler -integrated-as -c" - '' - # x86-64 Darwin gnat-bootstrap emits assembly - # with MOVQ as the mnemonic for quadword interunit moves - # such as `movq %rbp, %xmm0`. - # The clang integrated assembler recognises this as valid, - # but unfortunately the cctools-port GNU assembler does not; - # it instead uses MOVD as the mnemonic. - # The assembly that a GCC build emits is determined at build time - # and cannot be changed afterwards. - # - # To build GNAT on x86-64 Darwin, therefore, - # we need both the clang _and_ the cctools-port assemblers to be available: - # the former to build at least the stage1 compiler, - # and the latter at least to be detectable - # as the target for the final compiler. - # - # We choose to match the Aarch64 case above, - # wrapping the clang integrated assembler as `as`. - # It then seems sensible to wrap the cctools GNU assembler as `gas`. - # - + lib.optionalString (stdenv.isx86_64 && dualAs) '' - mv $out/bin/${targetPrefix}as $out/bin/${targetPrefix}gas - makeWrapper "${clang-unwrapped}/bin/clang" "$out/bin/${targetPrefix}as" \ - --add-flags "-x assembler -integrated-as -c" - '' - ); - - nativeBuildInputs = lib.optionals (!isCCToolsLLVM && (stdenv.isAarch64 || dualAs)) [ makeWrapper ]; + ${ + # These unprefixed because some tools expect to invoke them without it when cross-compiling to Darwin: + # - clang needs `dsymutil` when building with debug information; + # - meson needs `lipo` when cross-compiling to Darwin; and + # - meson also needs `install_name_tool` and `otool` when performing rpath cleanup on installation. + lib.optionalString (targetPrefix != "") '' + for bintool in dsymutil install_name_tool lipo otool; do + ln -s "$out/bin/${targetPrefix}$bintool" "$out/bin/$bintool" + done + '' + } + # Use the clang-integrated assembler. `as` in cctools is deprecated upstream and no longer built in nixpkgs. + makeWrapper "${lib.getBin clang-unwrapped}/bin/clang" "$out/bin/${targetPrefix}as" \ + --add-flags "-x assembler -integrated-as -c" + + ln -s '${lib.getBin cctools}/bin/${targetPrefix}ld' "$out/bin/${targetPrefix}ld" + ${linkManPages (lib.getMan cctools) "ld" "ld"} + # ${linkManPages (lib.getMan cctools) "ld-classic" "ld-classic"} + ${linkManPages (lib.getMan cctools) "ld64" "ld64"} + ''; + + __structuredAttrs = true; passthru = { - inherit targetPrefix; - isCCTools = true; + inherit cctools_cmds llvm_cmds targetPrefix; + isCCTools = true; # The fact ld64 is used instead of lld is why this isn’t `isLLVM`. }; meta = { - maintainers = with lib.maintainers; [ matthewbauer ]; + maintainers = with lib.maintainers; [ reckenrode ]; priority = 10; }; } diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index 377d84d9bf731..cc162d870a2e2 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation { sha256 = "0ns12q7vg9yand4dmdsps1917cavfbw67yl5q7bm6kb4ia5kkx13"; }; - outputs = [ "out" "dev" "man" ]; + outputs = [ "out" "dev" "gas" "man" ]; nativeBuildInputs = [ autoconf automake libtool autoreconfHook installShellFiles ] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ memstreamHook ]; @@ -178,6 +178,12 @@ stdenv.mkDerivation { popd ''; + postInstall = '' + # Move GNU as to its own output to prevent it from being used accidentally. + moveToOutput bin/gas "$gas" + moveToOutput libexec "$gas" + ''; + passthru = { inherit targetPrefix; }; diff --git a/pkgs/os-specific/darwin/raycast/default.nix b/pkgs/os-specific/darwin/raycast/default.nix index a49f1a305ce4a..17f7b47084005 100644 --- a/pkgs/os-specific/darwin/raycast/default.nix +++ b/pkgs/os-specific/darwin/raycast/default.nix @@ -11,12 +11,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { pname = "raycast"; - version = "1.77.1"; + version = "1.78.1"; src = fetchurl { name = "Raycast.dmg"; url = "https://releases.raycast.com/releases/${finalAttrs.version}/download?build=universal"; - hash = "sha256-+Itz6U1DHV9ZsgjzuvrfVtCJ1yiGSpVOkD28BmHibIQ="; + hash = "sha256-le1IB55vAXv1e+ll/K24jZ2Z0lqtEt3xKhwPxY+Ibis="; }; dontPatch = true; diff --git a/pkgs/os-specific/darwin/swiftbar/default.nix b/pkgs/os-specific/darwin/swiftbar/default.nix index f2cd30fd6f165..4a12dc2dfea73 100644 --- a/pkgs/os-specific/darwin/swiftbar/default.nix +++ b/pkgs/os-specific/darwin/swiftbar/default.nix @@ -1,7 +1,8 @@ -{ lib -, fetchzip -, stdenvNoCC -, makeWrapper +{ + lib, + fetchzip, + stdenvNoCC, + makeWrapper, }: stdenvNoCC.mkDerivation rec { @@ -17,9 +18,7 @@ stdenvNoCC.mkDerivation rec { dontConfigure = true; dontBuild = true; - nativeBuildInputs = [ - makeWrapper - ]; + nativeBuildInputs = [ makeWrapper ]; installPhase = '' runHook preInstall @@ -41,6 +40,6 @@ stdenvNoCC.mkDerivation rec { license = licenses.mit; platforms = platforms.darwin; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - maintainers = with maintainers; [ ivar ]; + maintainers = with maintainers; [ matteopacini ]; }; } diff --git a/pkgs/os-specific/linux/android-udev-rules/default.nix b/pkgs/os-specific/linux/android-udev-rules/default.nix index 5e3768447e28e..6c890b075f17a 100644 --- a/pkgs/os-specific/linux/android-udev-rules/default.nix +++ b/pkgs/os-specific/linux/android-udev-rules/default.nix @@ -6,13 +6,13 @@ stdenv.mkDerivation rec { pname = "android-udev-rules"; - version = "20240221"; + version = "20240625"; src = fetchFromGitHub { owner = "M0Rf30"; repo = "android-udev-rules"; rev = version; - hash = "sha256-Zbztl8ZFLS2UME8LtbahINKk6OUG5jo0O07awMXCPWY="; + hash = "sha256-SlUZElep8ZBkYl+5VPDESZ5sKwIQ+xa0+pB4WmJkNt8="; }; installPhase = '' diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 4c06ea352ee03..f70ba4c7aad18 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -1,4 +1,5 @@ { stdenv, lib, fetchFromGitLab, fetchpatch, makeWrapper, autoreconfHook +, autoconf-archive , pkg-config, which , flex, bison , linuxHeaders ? stdenv.cc.libc.linuxHeaders @@ -22,7 +23,7 @@ }: let - apparmor-version = "3.1.7"; + apparmor-version = "4.0.1"; apparmor-meta = component: with lib; { homepage = "https://apparmor.net/"; @@ -36,7 +37,7 @@ let owner = "apparmor"; repo = "apparmor"; rev = "v${apparmor-version}"; - hash = "sha256-AzY05bcpNYXix2GL4Rhc9d3RBA1pd2fwOa7yoiwc2nQ="; + hash = "sha256-0S/P62wi3/aPATvJL6afu+SebjoSHsTMu/WV9m7E1OE="; }; aa-teardown = writeShellScript "aa-teardown" '' @@ -86,6 +87,7 @@ let strictDeps = false; nativeBuildInputs = [ + autoconf-archive autoreconfHook bison flex diff --git a/pkgs/os-specific/linux/audit/default.nix b/pkgs/os-specific/linux/audit/default.nix index d5e38ea62fb8b..00afda1c605dd 100644 --- a/pkgs/os-specific/linux/audit/default.nix +++ b/pkgs/os-specific/linux/audit/default.nix @@ -1,12 +1,14 @@ { lib , stdenv , fetchurl +, fetchpatch , autoreconfHook , bash , buildPackages , linuxHeaders , python3 , swig +, pkgsCross # Enabling python support while cross compiling would be possible, but the # configure script tries executing python to gather info instead of relying on @@ -16,13 +18,26 @@ stdenv.mkDerivation (finalAttrs: { pname = "audit"; - version = "3.1.2"; + version = "4.0"; src = fetchurl { url = "https://people.redhat.com/sgrubb/audit/audit-${finalAttrs.version}.tar.gz"; - hash = "sha256-wLF5LR8KiMbxgocQUJy7mHBZ/GhxLJdmnKkOrhA9KH0="; + hash = "sha256-v0ItQSard6kqTDrDneVHPyeNw941ck0lGKSMe+FdVNg="; }; + patches = lib.optionals (!stdenv.hostPlatform.isGnu) [ + (fetchpatch { + name = "musl.patch"; + url = "https://github.com/linux-audit/audit-userspace/commit/64cb48e1e5137b8a389c7528e611617a98389bc7.patch"; + hash = "sha256-DN2F5w+2Llm80FZntH9dvdyT00pVBSgRu8DDFILyrlU="; + }) + (fetchpatch { + name = "musl.patch"; + url = "https://github.com/linux-audit/audit-userspace/commit/4192eb960388458c85d76e5e385cfeef48f02c79.patch"; + hash = "sha256-G6CJ9nBJSsTyJ0qq14PVo+YdInAvLLQtXcR25Q8V5/4="; + }) + ]; + postPatch = '' substituteInPlace bindings/swig/src/auditswig.i \ --replace "/usr/include/linux/audit.h" \ @@ -60,6 +75,10 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; + passthru.tests = { + musl = pkgsCross.musl64.audit; + }; + meta = { homepage = "https://people.redhat.com/sgrubb/audit/"; description = "Audit Library"; diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix index fb5a6ce28e1d8..39f03c475fdaa 100644 --- a/pkgs/os-specific/linux/cryptsetup/default.nix +++ b/pkgs/os-specific/linux/cryptsetup/default.nix @@ -14,14 +14,14 @@ stdenv.mkDerivation rec { pname = "cryptsetup"; - version = "2.7.1"; + version = "2.7.3"; outputs = [ "bin" "out" "dev" "man" ]; separateDebugInfo = true; src = fetchurl { url = "mirror://kernel/linux/utils/cryptsetup/v${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - hash = "sha256-2l0UGeKobgGqMv15WCzVTSCIV8tUG8ov1Cal/xqqu8M="; + hash = "sha256-t3KuT23wzucgCyjOqWDk2q/yogPS/VAr6rPBMXsHpFY="; }; patches = [ diff --git a/pkgs/os-specific/linux/decklink/default.nix b/pkgs/os-specific/linux/decklink/default.nix deleted file mode 100644 index a2811ddae8a57..0000000000000 --- a/pkgs/os-specific/linux/decklink/default.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ stdenv -, lib -, fetchpatch -, blackmagic-desktop-video -, kernel -}: - -stdenv.mkDerivation rec { - pname = "decklink"; - - # the download is a horrible curl mess. we reuse it between the kernel module - # and desktop service, since the version of the two have to match anyways. - # See pkgs/tools/video/blackmagic-desktop-video/default.nix for more. - inherit (blackmagic-desktop-video) src version; - - KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; - INSTALL_MOD_PATH = placeholder "out"; - - nativeBuildInputs = kernel.moduleBuildDependencies; - - patches = lib.optionals (lib.versionAtLeast kernel.version "6.8") [ - (fetchpatch { - name = "decklink-addMutex.patch"; - url = "https://aur.archlinux.org/cgit/aur.git/plain/01-addMutex.patch?h=decklink&id=132ce45a76e230cbfec4a3daac237ffe9b8a377a"; - sha256 = "sha256-YLIjO3wMrMoEZwMX5Fs9W4uRu9Xo8klzsjfhxS2wRfQ="; - }) - (fetchpatch { - name = "decklink-changeMaxOrder.patch"; - url = "https://aur.archlinux.org/cgit/aur.git/plain/02-changeMaxOrder.patch?h=decklink&id=132ce45a76e230cbfec4a3daac237ffe9b8a377a"; - sha256 = "sha256-/erUVYjpTuyaQaCSzSxwKgNocxijc1uNaUjnrJEMa6g="; - }) - ]; - - - postUnpack = let - arch = stdenv.hostPlatform.uname.processor; - in '' - tar xf Blackmagic_Desktop_Video_Linux_${lib.head (lib.splitString "a" version)}/other/${arch}/desktopvideo-${version}-${arch}.tar.gz - moduleRoot=$NIX_BUILD_TOP/desktopvideo-${version}-${stdenv.hostPlatform.uname.processor}/usr/src - sourceRoot=$moduleRoot - ''; - - - buildPhase = '' - runHook preBuild - - make -C $moduleRoot/blackmagic-${version} -j$NIX_BUILD_CORES - make -C $moduleRoot/blackmagic-io-${version} -j$NIX_BUILD_CORES - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - - make -C $KERNELDIR M=$moduleRoot/blackmagic-${version} modules_install - make -C $KERNELDIR M=$moduleRoot/blackmagic-io-${version} modules_install - - runHook postInstall - ''; - - meta = with lib; { - homepage = "https://www.blackmagicdesign.com/support/family/capture-and-playback"; - maintainers = [ maintainers.hexchen ]; - license = licenses.unfree; - description = "Kernel module for the Blackmagic Design Decklink cards"; - sourceProvenance = with lib.sourceTypes; [ binaryFirmware ]; - platforms = platforms.linux; - }; -} diff --git a/pkgs/os-specific/linux/dracut/default.nix b/pkgs/os-specific/linux/dracut/default.nix index 498f61dc9836e..39fc54d2a2c4b 100644 --- a/pkgs/os-specific/linux/dracut/default.nix +++ b/pkgs/os-specific/linux/dracut/default.nix @@ -104,7 +104,7 @@ stdenv.mkDerivation rec { homepage = "https://github.com/dracutdevs/dracut/wiki"; description = "Event driven initramfs infrastructure"; license = licenses.gpl2Plus; - maintainers = with maintainers; [ lilyinstarlight ]; + maintainers = with maintainers; [ ]; platforms = platforms.linux; }; } diff --git a/pkgs/os-specific/linux/edac-utils/default.nix b/pkgs/os-specific/linux/edac-utils/default.nix index b23e0d34401a9..db106c14b434a 100644 --- a/pkgs/os-specific/linux/edac-utils/default.nix +++ b/pkgs/os-specific/linux/edac-utils/default.nix @@ -1,32 +1,44 @@ -{ lib, stdenv, fetchFromGitHub, perl, makeWrapper +{ lib, stdenv, fetchFromGitHub, perl , sysfsutils, dmidecode, kmod }: stdenv.mkDerivation { pname = "edac-utils"; - version = "unstable-2015-01-07"; + version = "unstable-2023-01-30"; src = fetchFromGitHub { owner = "grondo"; repo = "edac-utils"; - rev = "f9aa96205f610de39a79ff43c7478b7ef02e3138"; - sha256 = "1dmfqb15ffldl5zirbmwiqzpxbcc2ny9rpfvxcfvpmh5b69knvdg"; + rev = "8fdc1d40e30f65737fef6c3ddcd1d2cd769f6277"; + hash = "sha256-jZGRrZ1sa4x0/TBJ5GsNVuWakmPNOU+oiOoXdhARunk="; }; - nativeBuildInputs = [ perl makeWrapper ]; - buildInputs = [ sysfsutils ]; + # Hard-code program paths instead of using PATH lookups. Also, labels.d and + # mainboard are for user-configurable data, so do not look for them in Nix + # store. + dmidecodeProgram = lib.getExe' dmidecode "dmidecode"; + modprobeProgram = lib.getExe' kmod "modprobe"; + postPatch = '' + substituteInPlace src/util/edac-ctl.in \ + --replace-fail 'find_prog ("dmidecode")' "\"$dmidecodeProgram\"" \ + --replace-fail 'find_prog ("modprobe") or exit (1)' "\"$modprobeProgram\"" \ + --replace-fail '"$sysconfdir/edac/labels.d"' '"/etc/edac/labels.d"' \ + --replace-fail '"$sysconfdir/edac/mainboard"' '"/etc/edac/mainboard"' + ''; - configureFlags = [ - "--sysconfdir=/etc" - "--localstatedir=/var" - ]; + # NB edac-utils needs Perl for configure script, but also edac-ctl program is + # a Perl script. Perl from buildInputs is used by patchShebangsAuto in + # fixupPhase to update the hash bang line. + strictDeps = true; + nativeBuildInputs = [ perl ]; + buildInputs = [ perl sysfsutils ]; installFlags = [ - "sysconfdir=\${out}/etc" + "sbindir=${placeholder "out"}/bin" ]; + # SysV init script is not relevant. postInstall = '' - wrapProgram "$out/sbin/edac-ctl" \ - --set PATH ${lib.makeBinPath [ dmidecode kmod ]} + rm -r "$out"/etc/init.d ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/ffado/default.nix b/pkgs/os-specific/linux/ffado/default.nix index 610f9d31353e2..47112a26c203a 100644 --- a/pkgs/os-specific/linux/ffado/default.nix +++ b/pkgs/os-specific/linux/ffado/default.nix @@ -1,39 +1,49 @@ -{ lib -, stdenv -, mkDerivation -, argp-standalone -, dbus -, dbus_cplusplus -, desktop-file-utils -, fetchurl -, fetchpatch -, glibmm -, libavc1394 -, libconfig -, libiec61883 -, libraw1394 -, libxmlxx3 -, pkg-config -, python3 -, scons -, which -, wrapQtAppsHook +{ + lib, + stdenv, + mkDerivation, + argp-standalone, + dbus, + dbus_cplusplus, + desktop-file-utils, + fetchurl, + fetchpatch, + glibmm, + libavc1394, + libconfig, + libiec61883, + libraw1394, + libxmlxx3, + pkg-config, + python311, + scons, + which, + wrapQtAppsHook, }: let - python = python3.withPackages (pkgs: with pkgs; [ pyqt5 dbus-python ]); + python = python311.withPackages ( + pkgs: with pkgs; [ + pyqt5 + dbus-python + ] + ); in mkDerivation rec { pname = "ffado"; version = "2.4.8"; + outputs = [ + "out" + "bin" + "dev" + ]; + src = fetchurl { url = "http://www.ffado.org/files/libffado-${version}.tgz"; - hash = "sha256-f0x561ehKw6uMSri0RZip+v1JHZuhixtywl0PVU/N44="; + hash = "sha256-0iFXYyGctOoHCdc232Ud80/wV81tiS7ItiS0uLKyq2Y="; }; - sourceRoot = "libffado-${version}/libffado"; - prePatch = '' substituteInPlace ./support/tools/ffado-diag.in \ --replace /lib/modules/ "/run/booted-system/kernel-modules/lib/modules/" @@ -51,15 +61,13 @@ mkDerivation rec { }) ]; - outputs = [ "out" "bin" "dev" ]; - nativeBuildInputs = [ desktop-file-utils - scons + (scons.override { python3 = python311; }) pkg-config which python - python3.pkgs.pyqt5 + python.pkgs.pyqt5 wrapQtAppsHook ]; @@ -71,7 +79,7 @@ mkDerivation rec { "WILL_DEAL_WITH_XDG_MYSELF=True" "BUILD_MIXER=True" "UDEVDIR=${placeholder "out"}/lib/udev/rules.d" - "PYPKGDIR=${placeholder "out"}/${python3.sitePackages}" + "PYPKGDIR=${placeholder "out"}/${python.sitePackages}" "BINDIR=${placeholder "bin"}/bin" "INCLUDEDIR=${placeholder "dev"}/include" "PYTHON_INTERPRETER=${python.interpreter}" @@ -116,7 +124,10 @@ mkDerivation rec { homepage = "http://www.ffado.org"; description = "FireWire audio drivers"; license = licenses.gpl3; - maintainers = with maintainers; [ goibhniu michojel ]; + maintainers = with maintainers; [ + goibhniu + michojel + ]; platforms = platforms.linux; }; } diff --git a/pkgs/os-specific/linux/ffado/fix-build.patch b/pkgs/os-specific/linux/ffado/fix-build.patch index 7e360932613f7..db4c47fa38d5f 100644 --- a/pkgs/os-specific/linux/ffado/fix-build.patch +++ b/pkgs/os-specific/linux/ffado/fix-build.patch @@ -1,9 +1,14 @@ From b0f2b20b23780dd2e67a01c15462070dd86c4ac1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar <jtojnar@gmail.com> Date: Sun, 3 Mar 2019 11:50:27 +0100 -Subject: [PATCH] Fix build on Nix +Subject: [PATCH] build: Add datadir option for /usr/share -We do not have global /usr. +Hardcoded /usr/share does not work for platforms that do not have global /usr like Nix. +Let’s introduce a new DATADIR option, that allows overriding the directory and use it for metainfodir. + +While at it, let’s also use it for SHAREDIR and MANDIR for consistency, +following the GNU directory convention: +https://www.gnu.org/prep/standards/html_node/Directory-Variables.html --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @@ -12,15 +17,48 @@ diff --git a/SConstruct b/SConstruct index 05755e4b..3fbdc1d8 100644 --- a/SConstruct +++ b/SConstruct -@@ -537,7 +537,7 @@ env['mandir'] = Template( env.destdir + env['MANDIR'] ).safe_substitute( env ) +@@ -49,9 +49,10 @@ + PathVariable( "BINDIR", "Overwrite the directory where apps are installed to.", "$PREFIX/bin", PathVariable.PathAccept ), + PathVariable( "LIBDIR", "Overwrite the directory where libs are installed to.", "$PREFIX/lib", PathVariable.PathAccept ), + PathVariable( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathVariable.PathAccept ), +- PathVariable( "SHAREDIR", "Overwrite the directory where misc shared files are installed to.", "$PREFIX/share/libffado", PathVariable.PathAccept ), ++ PathVariable( "DATADIR", "Overwrite the directory where platform-independent files are installed to.", "$PREFIX/share", PathVariable.PathAccept ), ++ PathVariable( "SHAREDIR", "Overwrite the directory where misc shared files are installed to.", "$DATADIR/libffado", PathVariable.PathAccept ), + PathVariable( "LIBDATADIR", "Location for architecture-dependent data.", "$LIBDIR/libffado", PathVariable.PathAccept ), +- PathVariable( "MANDIR", "Overwrite the directory where manpages are installed", "$PREFIX/man", PathVariable.PathAccept ), ++ PathVariable( "MANDIR", "Overwrite the directory where manpages are installed", "$DATADIR/man", PathVariable.PathAccept ), + PathVariable( "PYPKGDIR", "The directory where the python modules get installed.", + distutils.sysconfig.get_python_lib( prefix="$PREFIX" ), PathVariable.PathAccept ), + PathVariable( "UDEVDIR", "Overwrite the directory where udev rules are installed to.", "/lib/udev/rules.d/", PathVariable.PathAccept ), +@@ -523,6 +524,7 @@ + env['BINDIR'] = Template( env['BINDIR'] ).safe_substitute( env ) + env['LIBDIR'] = Template( env['LIBDIR'] ).safe_substitute( env ) + env['INCLUDEDIR'] = Template( env['INCLUDEDIR'] ).safe_substitute( env ) ++env['DATADIR'] = Template( env['DATADIR'] ).safe_substitute( env ) + env['SHAREDIR'] = Template( env['SHAREDIR'] ).safe_substitute( env ) + env['LIBDATADIR'] = Template( env['LIBDATADIR'] ).safe_substitute( env ) + env['UDEVDIR'] = Template( env['UDEVDIR'] ).safe_substitute( env ) +@@ -531,18 +533,21 @@ + env['bindir'] = Template( env.destdir + env['BINDIR'] ).safe_substitute( env ) + env['libdir'] = Template( env.destdir + env['LIBDIR'] ).safe_substitute( env ) + env['includedir'] = Template( env.destdir + env['INCLUDEDIR'] ).safe_substitute( env ) ++env['datadir'] = Template( env.destdir + env['DATADIR'] ).safe_substitute( env ) + env['sharedir'] = Template( env.destdir + env['SHAREDIR'] ).safe_substitute( env ) + env['libdatadir'] = Template( env.destdir + env['LIBDATADIR'] ).safe_substitute( env ) + env['mandir'] = Template( env.destdir + env['MANDIR'] ).safe_substitute( env ) env['pypkgdir'] = Template( env.destdir + env['PYPKGDIR'] ).safe_substitute( env ) env['udevdir'] = Template( env.destdir + env['UDEVDIR'] ).safe_substitute( env ) env['PYPKGDIR'] = Template( env['PYPKGDIR'] ).safe_substitute( env ) -env['metainfodir'] = Template( env.destdir + "/usr/share/metainfo" ).safe_substitute( env ) -+env['metainfodir'] = Template( env.destdir + env['SHAREDIR'] + "/metainfo" ).safe_substitute( env ) - +- ++env['metainfodir'] = Template( env.destdir + env['DATADIR'] + "/metainfo" ).safe_substitute( env ) ++ ++env.Command( target=env['datadir'], source="", action=Mkdir( env['datadir'] ) ) env.Command( target=env['sharedir'], source="", action=Mkdir( env['sharedir'] ) ) --- -2.19.2 - + env.Alias( "install", env['libdir'] ) + env.Alias( "install", env['includedir'] ) ++env.Alias( "install", env['datadir'] ) + env.Alias( "install", env['sharedir'] ) + env.Alias( "install", env['libdatadir'] ) + env.Alias( "install", env['bindir'] ) diff --git a/pkgs/os-specific/linux/hwdata/default.nix b/pkgs/os-specific/linux/hwdata/default.nix index 320f10d551380..484e63bb357c9 100644 --- a/pkgs/os-specific/linux/hwdata/default.nix +++ b/pkgs/os-specific/linux/hwdata/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "hwdata"; - version = "0.382"; + version = "0.383"; src = fetchFromGitHub { owner = "vcrhonek"; repo = "hwdata"; rev = "v${version}"; - hash = "sha256-j7ITcLilcnV8QCUFC/Ybv1dX6Kl36P0G9vBlrzifhFQ="; + hash = "sha256-jYD1/sl9ffe+lmrICLe32NU1u0Hi7ZfZrD4zWH+bxsk="; }; configureFlags = [ "--datadir=${placeholder "out"}/share" ]; diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix index effe5eb8526b9..15b8987b8cc05 100644 --- a/pkgs/os-specific/linux/iproute/default.nix +++ b/pkgs/os-specific/linux/iproute/default.nix @@ -6,17 +6,14 @@ stdenv.mkDerivation rec { pname = "iproute2"; - version = "6.8.0"; + version = "6.9.0"; src = fetchurl { url = "mirror://kernel/linux/utils/net/${pname}/${pname}-${version}.tar.xz"; - hash = "sha256-A6bMo9cakI0fFfe0lb4rj+hR+UFFjcRmSQDX9F/PaM4="; + hash = "sha256-L2Q9CeoRpKKgQ8kuK0abX3MijL8kGugGdgKW7Q7EE9A="; }; postPatch = '' - # Don't try to create /var/lib/arpd: - sed -e '/ARPDDIR/d' -i Makefile - substituteInPlace Makefile \ --replace "CC := gcc" "CC ?= $CC" ''; diff --git a/pkgs/os-specific/linux/ipset/default.nix b/pkgs/os-specific/linux/ipset/default.nix index 94a5a43b76e19..20a2b43143de5 100644 --- a/pkgs/os-specific/linux/ipset/default.nix +++ b/pkgs/os-specific/linux/ipset/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "ipset"; - version = "7.21"; + version = "7.22"; src = fetchurl { url = "https://ipset.netfilter.org/${pname}-${version}.tar.bz2"; - sha256 = "sha256-4sbOT886yziTyl01yGk1+ArXb8XMrmARhYQt92DgvGk="; + sha256 = "sha256-9qxaR8Pvn0xn/L31Xnkcv+OOsKSqG6rNEmRqFAq6zdk="; }; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/os-specific/linux/joycond/default.nix b/pkgs/os-specific/linux/joycond/default.nix index 5edc227732f80..0620f1dee7224 100644 --- a/pkgs/os-specific/linux/joycond/default.nix +++ b/pkgs/os-specific/linux/joycond/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { description = "Userspace daemon to combine joy-cons from the hid-nintendo kernel driver"; mainProgram = "joycond"; license = licenses.gpl3Only; - maintainers = [ maintainers.ivar ]; + maintainers = [ ]; platforms = platforms.linux; }; } diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 551d4cffbb923..e4d8706fb6a66 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -671,20 +671,29 @@ let }; security = { + # Report BUG() conditions and kill the offending process. + BUG = yes; + BUG_ON_DATA_CORRUPTION = yes; + FORTIFY_SOURCE = option yes; # https://googleprojectzero.blogspot.com/2019/11/bad-binder-android-in-wild-exploit.html DEBUG_LIST = yes; + HARDENED_USERCOPY = yes; RANDOMIZE_BASE = option yes; + STRICT_KERNEL_RWX = yes; + STRICT_MODULE_RWX = yes; STRICT_DEVMEM = mkDefault yes; # Filter access to /dev/mem IO_STRICT_DEVMEM = mkDefault yes; SECURITY_SELINUX_BOOTPARAM_VALUE = whenOlder "5.1" (freeform "0"); # Disable SELinux by default + # Prevent processes from ptracing non-children processes SECURITY_YAMA = option yes; # The goal of Landlock is to enable to restrict ambient rights (e.g. global filesystem access) for a set of processes. # This does not have any effect if a program does not support it SECURITY_LANDLOCK = whenAtLeast "5.13" yes; + DEVKMEM = whenOlder "5.13" no; # Disable /dev/kmem USER_NS = yes; # Support for user namespaces @@ -719,6 +728,10 @@ let # Enable support for page poisoning. Still needs to be enabled on the command line to actually work. PAGE_POISONING = yes; + # Randomize page allocator when page_alloc.shuffle=1 + SHUFFLE_PAGE_ALLOCATOR = whenAtLeast "5.2" yes; + + INIT_ON_ALLOC_DEFAULT_ON = whenAtLeast "5.3" yes; # Enable stack smashing protections in schedule() # See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.8&id=0d9e26329b0c9263d4d9e0422d80a0e73268c52f @@ -743,6 +756,10 @@ let # Mitigate straight line speculation at the cost of some file size SLS = whenBetween "5.17" "6.9" yes; MITIGATION_SLS = whenAtLeast "6.9" yes; + + DEFAULT_MMAP_MIN_ADDR = freeform "65536"; + } // optionalAttrs stdenv.hostPlatform.isAarch64 { + DEFAULT_MMAP_MIN_ADDR = freeform "32768"; }; microcode = { diff --git a/pkgs/os-specific/linux/kernel/hardened/config.nix b/pkgs/os-specific/linux/kernel/hardened/config.nix index d687366dbe2f8..0ab89d23952db 100644 --- a/pkgs/os-specific/linux/kernel/hardened/config.nix +++ b/pkgs/os-specific/linux/kernel/hardened/config.nix @@ -17,9 +17,6 @@ with (lib.kernel.whenHelpers version); assert (versionAtLeast version "4.9"); { - # Report BUG() conditions and kill the offending process. - BUG = yes; - # Mark LSM hooks read-only after init. SECURITY_WRITABLE_HOOKS n # conflicts with SECURITY_SELINUX_DISABLE y; disabling the latter # implicitly marks LSM hooks read-only after init. @@ -31,8 +28,6 @@ assert (versionAtLeast version "4.9"); SECURITY_SELINUX_DISABLE = whenOlder "6.4" no; # On 6.4: error: unused option: SECURITY_SELINUX_DISABLE SECURITY_WRITABLE_HOOKS = option no; - STRICT_KERNEL_RWX = yes; - # Perform additional validation of commonly targeted structures. DEBUG_CREDENTIALS = whenOlder "6.6" yes; DEBUG_NOTIFIERS = yes; @@ -51,16 +46,11 @@ assert (versionAtLeast version "4.9"); # restricts loading of line disciplines via TIOCSETD ioctl to CAP_SYS_MODULE CONFIG_LDISC_AUTOLOAD = option no; - # Randomize page allocator when page_alloc.shuffle=1 - SHUFFLE_PAGE_ALLOCATOR = whenAtLeast "5.2" yes; - # Wipe higher-level memory allocations on free() with page_poison=1 - PAGE_POISONING = yes; PAGE_POISONING_NO_SANITY = whenOlder "5.11" yes; PAGE_POISONING_ZERO = whenOlder "5.11" yes; - # Enable init_on_alloc and init_on_free by default - INIT_ON_ALLOC_DEFAULT_ON = whenAtLeast "5.3" yes; + # Enable init_on_free by default INIT_ON_FREE_DEFAULT_ON = whenAtLeast "5.3" yes; # Wipe all caller-used registers on exit from a function @@ -113,9 +103,6 @@ assert (versionAtLeast version "4.9"); CC_STACKPROTECTOR_REGULAR = lib.mkForce (whenOlder "4.18" no); CC_STACKPROTECTOR_STRONG = whenOlder "4.18" yes; - # Detect out-of-bound reads/writes and use-after-free - KFENCE = whenAtLeast "5.12" yes; - # CONFIG_DEVMEM=n causes these to not exist anymore. STRICT_DEVMEM = option no; IO_STRICT_DEVMEM = option no; @@ -126,8 +113,4 @@ assert (versionAtLeast version "4.9"); # not needed for less than a decade old glibc versions LEGACY_VSYSCALL_NONE = yes; - - # Straight-Line-Speculation - # https://lwn.net/Articles/877845/ - SLS = option yes; } diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index 4722c0a64a057..e45449d20e60c 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -1,38 +1,38 @@ { "testing": { - "version": "6.10-rc4", - "hash": "sha256:1cx7c25fa8pvabhwph0rdqdryalxgl7rs1ry0v4k048bxpisvahf" + "version": "6.10-rc6", + "hash": "sha256:0ajhx148rrk26mhcv03g2gdy0s9hv0vp95rvwfwsjkb0iwm0nfvy" }, "6.1": { - "version": "6.1.95", - "hash": "sha256:1gfz2j6iixbr0dfkb8jkwnb4gicrm5rc5lsa24wmyrkm3nmg0q19" + "version": "6.1.97", + "hash": "sha256:1bs1pv9h5lwjadl4wjylrl3zd125ccxqkpb2drqjh8s56rgq82w9" }, "5.15": { - "version": "5.15.161", - "hash": "sha256:0k277hz6nq62v0xfc1n2hc69cyvmnxpl0qcbszinajywh23gfafn" + "version": "5.15.162", + "hash": "sha256:0z0s5gk8akcbpb99jp08px78fhr8r6kkb7dpl01b3rrc2pmc1gwi" }, "5.10": { - "version": "5.10.220", - "hash": "sha256:16z1xqm7djm8pl15s5wvgc4pwq81gydcf00jpxfplw794kwszhvw" + "version": "5.10.221", + "hash": "sha256:09975sby114mwfb8x2rlpaps6vb60dvs8f20cmb7hkxcxdzx87fs" }, "5.4": { - "version": "5.4.278", - "hash": "sha256:1245zf7vk2fyprw9fspljqy9wlzma9bayri7xx2g8iam2430d875" + "version": "5.4.279", + "hash": "sha256:0pja69n66hsl1r5jbzqww1hwsmqdlxmq6qv9rqx5qnrr4rml765j" }, "4.19": { - "version": "4.19.316", - "hash": "sha256:0lmyhwr4la7kvim7jqdi29scjkvqp9crpvdbhpb4j8d7mj5kgzz4" + "version": "4.19.317", + "hash": "sha256:109mk4zscm8611xs3bchnr94gasvw3vxsi6zhp3f2y132g670aq6" }, "6.6": { - "version": "6.6.35", - "hash": "sha256:17nxymy3r9q45cfzc9rqp937m37zr1b8fjn1m0x0dv8jhxrfxqzw" + "version": "6.6.37", + "hash": "sha256:051j3ydf54bb027a6f7hb2y6r8y82p1hf4wd3x5gx546f1vnx5zk" }, "6.8": { "version": "6.8.12", "hash": "sha256:0fb0m0fv4521g63gq04d7lm6hy8169s1rykiav5bkd99s9b1kcqr" }, "6.9": { - "version": "6.9.6", - "hash": "sha256:0jvbv5g9xx76a4ni0b66gzj5i2y77gpmfdg0mdsg564rp3i6chsx" + "version": "6.9.8", + "hash": "sha256:109j8f69bsvk2a61ihs3r77jv05fm4aqvih8lyf6qcc8gdxjcj7h" } } diff --git a/pkgs/os-specific/linux/kernel/linux-libre.nix b/pkgs/os-specific/linux/kernel/linux-libre.nix index b5be3ba7230a9..2d9d51afe4e5a 100644 --- a/pkgs/os-specific/linux/kernel/linux-libre.nix +++ b/pkgs/os-specific/linux/kernel/linux-libre.nix @@ -43,6 +43,6 @@ in linux.override { passthru.updateScript = ./update-libre.sh; - maintainers = with lib.maintainers; [ qyliss ivar ]; + maintainers = with lib.maintainers; [ qyliss ]; }; } diff --git a/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix b/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix index ec7f104bcb1d2..ef62b0df57f2e 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix @@ -6,7 +6,7 @@ , ... } @ args: let - version = "5.10.218-rt110"; # updated by ./update-rt.sh + version = "5.10.219-rt111"; # updated by ./update-rt.sh branch = lib.versions.majorMinor version; kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { @@ -18,14 +18,14 @@ in buildLinux (args // { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${kversion}.tar.xz"; - sha256 = "1mmj5hwm5i16gc1y4nzr1cs882vi6vrihrincdcivv63x11v4dlw"; + sha256 = "0c6dhi6w8likvyyzw7wj2fqhz8nhv760kkic8bk66r1prhakzdwk"; }; kernelPatches = let rt-patch = { name = "rt"; patch = fetchurl { url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz"; - sha256 = "0zam7hlcrphxv53jcza7sw0lv8a9mz15cl35adwb2rd2y1x9nhad"; + sha256 = "0imnwj8210cjvmr90yhcc0nn80s3wlc5n2cdrnbg72lm4dny2qpn"; }; }; in [ rt-patch ] ++ kernelPatches; diff --git a/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix b/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix index 2fc18c76e5706..7863cf42f7dd7 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix @@ -6,7 +6,7 @@ , ... } @ args: let - version = "5.4.271-rt89"; # updated by ./update-rt.sh + version = "5.4.278-rt91"; # updated by ./update-rt.sh branch = lib.versions.majorMinor version; kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { @@ -15,14 +15,14 @@ in buildLinux (args // { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${kversion}.tar.xz"; - sha256 = "0l2qv4xlhnry9crs90rkihsxyny6jz8kxw08bfad7nys9hrn3g6d"; + sha256 = "1245zf7vk2fyprw9fspljqy9wlzma9bayri7xx2g8iam2430d875"; }; kernelPatches = let rt-patch = { name = "rt"; patch = fetchurl { url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz"; - sha256 = "15k9jja5yd9zf5yhd7hhydwh4hksg2mybk66jhdjsryh4w9jav7z"; + sha256 = "0s1ars3d18jg55kpvk6q5b6rk66c74d2khd2mxzdm5ifgm47047k"; }; }; in [ rt-patch ] ++ kernelPatches; diff --git a/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix b/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix index a515cc1924fd9..1161162981ea1 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix @@ -6,7 +6,7 @@ , ... } @ args: let - version = "6.1.94-rt33"; # updated by ./update-rt.sh + version = "6.1.96-rt35"; # updated by ./update-rt.sh branch = lib.versions.majorMinor version; kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { @@ -19,14 +19,14 @@ in buildLinux (args // { src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${kversion}.tar.xz"; - sha256 = "0sakp5k4q2xfd3la7j8s2rcbvndh6fdqgzz5ivyqf0df4anp3siq"; + sha256 = "1ab290vm6h8vj1qi1qhxzh9kc6dbgpkwybcwzw1aprz5kl3cjxry"; }; kernelPatches = let rt-patch = { name = "rt"; patch = fetchurl { url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz"; - sha256 = "0yawgw6s8zd6a2n165aqg861giamgpsissj9mw6ax3a7wvg19zjr"; + sha256 = "1adjwxzx37w70h11ig6wcii8xb4dggw5x6si15zlsnr61dalys2d"; }; }; in [ rt-patch ] ++ kernelPatches; diff --git a/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix b/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix index b0cda7d0710be..8eab0d2b45f8d 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix @@ -6,7 +6,7 @@ , ... } @ args: let - version = "6.6.34-rt33"; # updated by ./update-rt.sh + version = "6.6.36-rt35"; # updated by ./update-rt.sh branch = lib.versions.majorMinor version; kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { @@ -19,14 +19,14 @@ in buildLinux (args // { src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${kversion}.tar.xz"; - sha256 = "180v8q5376gl6zmjd54qcb1wpmz7cq299bdbhmz738rsb67yrq64"; + sha256 = "1mfdw2prjb54r19y22sm37q8spnk6lyk162ima7gps1pnwl6hrxr"; }; kernelPatches = let rt-patch = { name = "rt"; patch = fetchurl { url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz"; - sha256 = "1sbbdv3mcca04g27vc7n4xv4kfhn9nz8xrhzzwc2r3f2x83ficwp"; + sha256 = "154wfx6aa9yxkavf05vka8spvx99pa4svq02b6kb1zfrq6r93bq6"; }; }; in [ rt-patch ] ++ kernelPatches; diff --git a/pkgs/os-specific/linux/kernel/mainline.nix b/pkgs/os-specific/linux/kernel/mainline.nix index 4e1d5b8a9e87c..862ba8e8ddcce 100644 --- a/pkgs/os-specific/linux/kernel/mainline.nix +++ b/pkgs/os-specific/linux/kernel/mainline.nix @@ -1,7 +1,10 @@ +let + allKernels = builtins.fromJSON (builtins.readFile ./kernels-org.json); +in + { branch, lib, fetchurl, fetchzip, buildLinux, ... } @ args: let - allKernels = builtins.fromJSON (builtins.readFile ./kernels-org.json); thisKernel = allKernels.${branch}; inherit (thisKernel) version; diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 323b77e851404..5f20d14137c4b 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -1,5 +1,5 @@ { lib, stdenv, buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl -, cpio, elfutils, zstd, python3Minimal, zlib, pahole, kmod, ubootTools +, cpio, elfutils, hexdump, zstd, python3Minimal, zlib, pahole, kmod, ubootTools , fetchpatch , rustc, rust-bindgen, rustPlatform }: @@ -121,6 +121,7 @@ let pahole perl elfutils + hexdump # module makefiles often run uname commands to find out the kernel version (buildPackages.deterministic-uname.override { inherit modDirVersion; }) ] @@ -312,7 +313,7 @@ let installTargets = [ (kernelConf.installTarget or ( /**/ if kernelConf.target == "uImage" && stdenv.hostPlatform.linuxArch == "arm" then "uinstall" - else if kernelConf.target == "zImage" || kernelConf.target == "Image.gz" then "zinstall" + else if kernelConf.target == "zImage" || kernelConf.target == "Image.gz" || kernelConf.target == "vmlinuz.efi" then "zinstall" else "install")) ]; diff --git a/pkgs/os-specific/linux/kernel/perf/default.nix b/pkgs/os-specific/linux/kernel/perf/default.nix index 851a4c8d5d7b6..a54e5c04e214d 100644 --- a/pkgs/os-specific/linux/kernel/perf/default.nix +++ b/pkgs/os-specific/linux/kernel/perf/default.nix @@ -128,17 +128,12 @@ stdenv.mkDerivation { ++ lib.optional (lib.versionAtLeast kernel.version "5.8") libpfm ++ lib.optional (lib.versionAtLeast kernel.version "6.0") python3.pkgs.setuptools; - env.NIX_CFLAGS_COMPILE = toString ([ + env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=cpp" "-Wno-error=bool-compare" "-Wno-error=deprecated-declarations" "-Wno-error=stringop-truncation" - ] ++ lib.optionals (stdenv.cc.isGNU && lib.versions.major stdenv.cc.version == "13") [ - # Workaround gcc bug that causes enev simplest `perf top` runs to - # crash: https://gcc.gnu.org/PR111009. - # Can be removed once gcc-13 is updated past 13.2.0. - "-O1" - ]); + ]; doCheck = false; # requires "sparse" diff --git a/pkgs/os-specific/linux/kernel/xanmod-kernels.nix b/pkgs/os-specific/linux/kernel/xanmod-kernels.nix index b2c4d0a6a6695..c2f7ef4447b7f 100644 --- a/pkgs/os-specific/linux/kernel/xanmod-kernels.nix +++ b/pkgs/os-specific/linux/kernel/xanmod-kernels.nix @@ -6,14 +6,14 @@ let # NOTE: When updating these, please also take a look at the changes done to # kernel config in the xanmod version commit ltsVariant = { - version = "6.6.33"; - hash = "sha256-3qGxIYNVm2f69rym0Ya1X497G7yRNj3lLCtVgyEZ9yw="; + version = "6.6.36"; + hash = "sha256-8L8e5iP4pvIvgqHmQYhFRCbgLvuFOXr7nkBe0VnuCzw="; variant = "lts"; }; mainVariant = { - version = "6.9.4"; - hash = "sha256-gY0t77aPWOuRZFESNp0OLIsjLAv+rf0NHbab9WF2VtA="; + version = "6.9.7"; + hash = "sha256-hmVcwC1PHjyCw43IpJ99y72qFXSX5lbbh6+1TqdXzag="; variant = "main"; }; diff --git a/pkgs/os-specific/linux/kernel/zen-kernels.nix b/pkgs/os-specific/linux/kernel/zen-kernels.nix index 9d15662162607..77d66ecd1d440 100644 --- a/pkgs/os-specific/linux/kernel/zen-kernels.nix +++ b/pkgs/os-specific/linux/kernel/zen-kernels.nix @@ -4,16 +4,16 @@ let # comments with variant added for update script # ./update-zen.py zen zenVariant = { - version = "6.9.6"; #zen + version = "6.9.7"; #zen suffix = "zen1"; #zen - sha256 = "09s3h4wiqfh8nsb1xw78qn2pqdjm8cff89f1q8r2p8hfzs6zpc1b"; #zen + sha256 = "1hs238vpwna8fry65x2909npw97b8zyvbadigl1yqm6f4ibcmhkj"; #zen isLqx = false; }; # ./update-zen.py lqx lqxVariant = { - version = "6.9.5"; #lqx + version = "6.9.7"; #lqx suffix = "lqx1"; #lqx - sha256 = "0r3pgjfyza3vkvp7kw1s7sn1gf4hxq6r6qs5wvv76gmff7s399yz"; #lqx + sha256 = "09z48hnjw0qfvn3b7gm9gs7ixki590wcgy7pm0cw2y41c67f725y"; #lqx isLqx = true; }; zenKernelsFor = { version, suffix, sha256, isLqx }: buildLinux (args // { diff --git a/pkgs/os-specific/linux/libbpf/default.nix b/pkgs/os-specific/linux/libbpf/default.nix index 6a0ee908347ca..032283711cf38 100644 --- a/pkgs/os-specific/linux/libbpf/default.nix +++ b/pkgs/os-specific/linux/libbpf/default.nix @@ -14,13 +14,13 @@ stdenv.mkDerivation rec { pname = "libbpf"; - version = "1.4.2"; + version = "1.4.3"; src = fetchFromGitHub { owner = "libbpf"; repo = "libbpf"; rev = "v${version}"; - sha256 = "sha256-PlGr/qZbKnaY37wikdmX/iYtP11WHShn1I7vACUgLG0="; + sha256 = "sha256-lcIOgghlBKrDCBDdO0hryjt8KADQd6aroQMun3ein2o="; }; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/os-specific/linux/libsemanage/default.nix b/pkgs/os-specific/linux/libsemanage/default.nix index f289287743b89..966ac7c945b05 100644 --- a/pkgs/os-specific/linux/libsemanage/default.nix +++ b/pkgs/os-specific/linux/libsemanage/default.nix @@ -6,12 +6,12 @@ with lib; stdenv.mkDerivation rec { pname = "libsemanage"; - version = "3.6"; + version = "3.7"; inherit (libsepol) se_url; src = fetchurl { url = "${se_url}/${version}/libsemanage-${version}.tar.gz"; - sha256 = "sha256-QROPRiIkOeEkLyfBWH6Vz1SgWSWarxaB22QswwxODWA="; + sha256 = "sha256-4WbK4ppBfasAjbnKCHQCPzU6MBewdpOgNu2XSH7aNbE="; }; outputs = [ "out" "dev" "man" ] ++ optional enablePython "py"; diff --git a/pkgs/os-specific/linux/libzbc/default.nix b/pkgs/os-specific/linux/libzbc/default.nix index e2da36d9dc793..7bee9500429eb 100644 --- a/pkgs/os-specific/linux/libzbc/default.nix +++ b/pkgs/os-specific/linux/libzbc/default.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "libzbc"; - version = "5.14.0"; + version = "6.0.0"; src = fetchFromGitHub { owner = "westerndigitalcorporation"; repo = "libzbc"; rev = "v${version}"; - sha256 = "sha256-+MBk2ZUr3Vt6pZFb4gTXMOzKBlf1EXMF8y/c1iDrIZM="; + sha256 = "sha256-5VqFTtWZJBP+uUKru46KKPSO+2Nh4EU4AmrA20czZOc="; }; nativeBuildInputs = [ diff --git a/pkgs/os-specific/linux/linuxptp/default.nix b/pkgs/os-specific/linux/linuxptp/default.nix index de215024555d8..23f79e7f66536 100644 --- a/pkgs/os-specific/linux/linuxptp/default.nix +++ b/pkgs/os-specific/linux/linuxptp/default.nix @@ -1,17 +1,21 @@ -{ lib, stdenv, fetchurl, linuxHeaders } : +{ lib, stdenv, fetchFromGitHub, linuxHeaders } : stdenv.mkDerivation rec { pname = "linuxptp"; - version = "4.2"; + version = "4.3"; - src = fetchurl { - url = "mirror://sourceforge/linuxptp/${pname}-${version}.tgz"; - hash = "sha256-cOOOXSdk4CF0Q9pvFOiEb+QBpHIpOsE42EGcB6ZlRHo="; + src = fetchFromGitHub { + owner = "nwtime"; + repo = "linuxptp"; + rev = "v${version}"; + hash = "sha256-FFBbbmVPP74p/OkqNXXgynBS/NcuPoYs3OCof11NZOI="; }; + outputs = [ "out" "man" ]; + postPatch = '' - substituteInPlace incdefs.sh --replace \ + substituteInPlace incdefs.sh --replace-fail \ '/usr/include/linux/' "${linuxHeaders}/include/linux/" ''; @@ -28,7 +32,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Implementation of the Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux"; - homepage = "https://linuxptp.sourceforge.net/"; + homepage = "https://linuxptp.nwtime.org"; maintainers = [ maintainers.markuskowa ]; license = licenses.gpl2Only; platforms = platforms.linux; diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix index 88a4f33b2f3f0..e3b8bc97e4d7b 100644 --- a/pkgs/os-specific/linux/nfs-utils/default.nix +++ b/pkgs/os-specific/linux/nfs-utils/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, fetchpatch, lib, pkg-config, util-linux, libcap, libtirpc, libevent , sqlite, libkrb5, kmod, libuuid, keyutils, lvm2, systemd, coreutils, tcp_wrappers -, python3, buildPackages, nixosTests, rpcsvc-proto -, enablePython ? true +, python3, buildPackages, nixosTests, rpcsvc-proto, openldap +, enablePython ? true, enableLdap ? true }: let @@ -10,11 +10,11 @@ in stdenv.mkDerivation rec { pname = "nfs-utils"; - version = "2.6.2"; + version = "2.6.4"; src = fetchurl { url = "mirror://kernel/linux/utils/nfs-utils/${version}/${pname}-${version}.tar.xz"; - hash = "sha256-UgCHPoHE1hDiRi/CYv4YE18tvni3l5+VrM0VmuZNUBE="; + hash = "sha256-AbOw+5x9C7q/URTHNlQgMHSMeI7C/Zc0dEIB6bChEZ0="; }; # libnfsidmap is built together with nfs-utils from the same source, @@ -26,7 +26,8 @@ stdenv.mkDerivation rec { buildInputs = [ libtirpc libcap libevent sqlite lvm2 libuuid keyutils libkrb5 tcp_wrappers - ] ++ lib.optional enablePython python3; + ] ++ lib.optional enablePython python3 + ++ lib.optional enableLdap openldap; enableParallelBuilding = true; @@ -47,7 +48,7 @@ stdenv.mkDerivation rec { "--with-pluginpath=${placeholder "lib"}/lib/libnfsidmap" # this installs libnfsidmap "--with-rpcgen=${buildPackages.rpcsvc-proto}/bin/rpcgen" "--with-modprobedir=${placeholder "out"}/etc/modprobe.d" - ]; + ] ++ lib.optional enableLdap "--with-ldap"; patches = lib.optionals stdenv.hostPlatform.isMusl [ # http://openwall.com/lists/musl/2015/08/18/10 @@ -68,7 +69,7 @@ stdenv.mkDerivation rec { substituteInPlace systemd/nfs-utils.service \ --replace "/bin/true" "${coreutils}/bin/true" - substituteInPlace tools/nfsrahead/Makefile.in \ + substituteInPlace tools/nfsrahead/Makefile.in systemd/Makefile.in \ --replace "/usr/lib/udev/rules.d/" "$out/lib/udev/rules.d/" substituteInPlace utils/mount/Makefile.in \ diff --git a/pkgs/os-specific/linux/nvidia-x11/builder.sh b/pkgs/os-specific/linux/nvidia-x11/builder.sh index aa614aec12839..dea9ab721a957 100755 --- a/pkgs/os-specific/linux/nvidia-x11/builder.sh +++ b/pkgs/os-specific/linux/nvidia-x11/builder.sh @@ -217,8 +217,10 @@ installPhase() { --set-rpath $out/lib:$libPath $bin/bin/$i fi done - # FIXME: needs PATH and other fixes - # install -Dm755 nvidia-bug-report.sh $bin/bin/nvidia-bug-report.sh + substituteInPlace nvidia-bug-report.sh \ + --replace /bin/grep grep \ + --replace /bin/ls ls + install -Dm755 nvidia-bug-report.sh $bin/bin/nvidia-bug-report.sh fi runHook postInstall diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index e08ffa1500a1d..fe2e9951bf855 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -42,12 +42,12 @@ rec { }; latest = selectHighestVersion production (generic { - version = "550.54.14"; - sha256_64bit = "sha256-jEl/8c/HwxD7h1FJvDD6pP0m0iN7LLps0uiweAFXz+M="; - sha256_aarch64 = "sha256-sProBhYziFwk9rDAR2SbRiSaO7RMrf+/ZYryj4BkLB0="; - openSha256 = "sha256-F+9MWtpIQTF18F2CftCJxQ6WwpA8BVmRGEq3FhHLuYw="; - settingsSha256 = "sha256-m2rNASJp0i0Ez2OuqL+JpgEF0Yd8sYVCyrOoo/ln2a4="; - persistencedSha256 = "sha256-XaPN8jVTjdag9frLPgBtqvO/goB5zxeGzaTU0CdL6C4="; + version = "555.58.02"; + sha256_64bit = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM="; + sha256_aarch64 = "sha256-wb20isMrRg8PeQBU96lWJzBMkjfySAUaqt4EgZnhyF8="; + openSha256 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY="; + settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8="; + persistencedSha256 = "sha256-a1D7ZZmcKFWfPjjH1REqPM5j/YLWKnbkP9qfRyIyxAw="; }); beta = selectHighestVersion latest (generic { @@ -62,11 +62,11 @@ rec { # Vulkan developer beta driver # See here for more information: https://developer.nvidia.com/vulkan-driver vulkan_beta = generic rec { - version = "550.40.63"; + version = "550.40.65"; persistencedVersion = "550.54.14"; settingsVersion = "550.54.14"; - sha256_64bit = "sha256-YvlNgxcFsCl3DzHFpKe+VXzfc0QIgf3N/hTKsWZ7gDE="; - openSha256 = "sha256-mITh1kdSPtB+jP6TDHw04EN7gRx48KGbzbLO0wTSS/U="; + sha256_64bit = "sha256-du86GHMBxzUkrP+nDzModBdxH3d1TueLPH5KeYSNKYU="; + openSha256 = "sha256-REBOh5bW7vUXa0sIGWddahPd1SR3GwBN4nmpv+m4Tak="; settingsSha256 = "sha256-m2rNASJp0i0Ez2OuqL+JpgEF0Yd8sYVCyrOoo/ln2a4="; persistencedSha256 = "sha256-XaPN8jVTjdag9frLPgBtqvO/goB5zxeGzaTU0CdL6C4="; url = "https://developer.nvidia.com/downloads/vulkan-beta-${lib.concatStrings (lib.splitVersion version)}-linux"; diff --git a/pkgs/os-specific/linux/oxtools/default.nix b/pkgs/os-specific/linux/oxtools/default.nix index c16e12ab5e142..fcb5d17dee152 100644 --- a/pkgs/os-specific/linux/oxtools/default.nix +++ b/pkgs/os-specific/linux/oxtools/default.nix @@ -4,13 +4,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "0xtools"; - version = "1.2.4"; + version = "2.0.2"; src = fetchFromGitHub { owner = "tanelpoder"; repo = "0xtools"; rev = "v${finalAttrs.version}"; - hash = "sha256-h0/HIbwb1CvFUh/NpozDUCjYGCH647lC7JhbpDCvaLk="; + hash = "sha256-S2jGF6wyjE9okbren/+p37zDr+eHUE8gJe/sbsXX4f4="; }; postPatch = '' diff --git a/pkgs/os-specific/linux/piper/default.nix b/pkgs/os-specific/linux/piper/default.nix index d646f004893c2..bba3843f4f4c5 100644 --- a/pkgs/os-specific/linux/piper/default.nix +++ b/pkgs/os-specific/linux/piper/default.nix @@ -1,5 +1,5 @@ { lib, meson, ninja, pkg-config, gettext, fetchFromGitHub, python3 -, wrapGAppsHook3, gtk3, glib, desktop-file-utils, appstream-glib, gnome +, wrapGAppsHook3, gtk3, glib, desktop-file-utils, appstream-glib, adwaita-icon-theme , gobject-introspection, librsvg }: python3.pkgs.buildPythonApplication rec { @@ -17,7 +17,7 @@ python3.pkgs.buildPythonApplication rec { nativeBuildInputs = [ meson ninja gettext pkg-config wrapGAppsHook3 desktop-file-utils appstream-glib gobject-introspection ]; buildInputs = [ - gtk3 glib gnome.adwaita-icon-theme python3 librsvg + gtk3 glib adwaita-icon-theme python3 librsvg ]; propagatedBuildInputs = with python3.pkgs; [ lxml evdev pygobject3 ]; diff --git a/pkgs/os-specific/linux/policycoreutils/default.nix b/pkgs/os-specific/linux/policycoreutils/default.nix index bcb5dafa137b6..6a2296fda4fce 100644 --- a/pkgs/os-specific/linux/policycoreutils/default.nix +++ b/pkgs/os-specific/linux/policycoreutils/default.nix @@ -2,12 +2,12 @@ stdenv.mkDerivation rec { pname = "policycoreutils"; - version = "3.6"; + version = "3.7"; inherit (libsepol) se_url; src = fetchurl { url = "${se_url}/${version}/policycoreutils-${version}.tar.gz"; - hash = "sha256-p2rEMepAo1qDFkzpAHkJwcbBL9EFZif2IhROSnBcCiw="; + hash = "sha256-WP5OSB7ftEVsEUklRC4ROJ3xc5SSWs26PeIRFFzl6pg="; }; postPatch = '' diff --git a/pkgs/os-specific/linux/power-profiles-daemon/default.nix b/pkgs/os-specific/linux/power-profiles-daemon/default.nix index f7145bc02ebe7..be984c5648607 100644 --- a/pkgs/os-specific/linux/power-profiles-daemon/default.nix +++ b/pkgs/os-specific/linux/power-profiles-daemon/default.nix @@ -127,6 +127,6 @@ stdenv.mkDerivation rec { mainProgram = "powerprofilesctl"; platforms = platforms.linux; license = licenses.gpl3Plus; - maintainers = with maintainers; [ mvnetbiz picnoir ]; + maintainers = with maintainers; [ mvnetbiz picnoir lyndeno ]; }; } diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index 3a3016d14b4be..664e499cd1d45 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -36,13 +36,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "prl-tools"; - version = "19.4.0-54962"; + version = "19.4.1-54985"; # We download the full distribution to extract prl-tools-lin.iso from # => ${dmg}/Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso src = fetchurl { url = "https://download.parallels.com/desktop/v${lib.versions.major finalAttrs.version}/${finalAttrs.version}/ParallelsDesktop-${finalAttrs.version}.dmg"; - hash = "sha256-c/MrWUvwY/Z38uOBbetJSVkZlwkdzFhw6wpk1L0BuQs="; + hash = "sha256-VBHCsxaMI6mfmc/iQ4hJW/592rKck9HilTX2Hq7Hb5s="; }; hardeningDisable = [ "pic" "format" ]; diff --git a/pkgs/os-specific/linux/rtl8814au/default.nix b/pkgs/os-specific/linux/rtl8814au/default.nix index bef60b52814d8..fbe1d62f28d3d 100644 --- a/pkgs/os-specific/linux/rtl8814au/default.nix +++ b/pkgs/os-specific/linux/rtl8814au/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation { pname = "rtl8814au"; - version = "${kernel.version}-unstable-2024-03-19"; + version = "${kernel.version}-unstable-2024-05-26"; src = fetchFromGitHub { owner = "morrownr"; repo = "8814au"; - rev = "d7945c1e0244c83cbbad4da331648246f12eaee9"; - hash = "sha256-idjHlvyFpQgLGfNAPpZKRnLdXnAogUW3qGHC1WzGVmA="; + rev = "810573647b837d88c4191597a0ea6d226f69f64c"; + hash = "sha256-AaOnUy3igocsCF/FNogn+z+QcQiid7U7XimE68wAco0="; }; nativeBuildInputs = kernel.moduleBuildDependencies; diff --git a/pkgs/os-specific/linux/rtl8821ce/default.nix b/pkgs/os-specific/linux/rtl8821ce/default.nix index 5f9e2e8cf10d4..434397ebc7c1a 100644 --- a/pkgs/os-specific/linux/rtl8821ce/default.nix +++ b/pkgs/os-specific/linux/rtl8821ce/default.nix @@ -1,19 +1,20 @@ -{ lib -, stdenv -, fetchFromGitHub -, kernel -, bc +{ + lib, + stdenv, + fetchFromGitHub, + kernel, + bc, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "rtl8821ce"; - version = "${kernel.version}-unstable-2024-01-20"; + version = "${kernel.version}-unstable-2024-03-26"; src = fetchFromGitHub { owner = "tomaspinho"; repo = "rtl8821ce"; - rev = "66983b69120a13699acf40a12979317f29012111"; - hash = "sha256-Zxb9cOgP67QdCeTNEme0tAsBqd9j/2k+gcE1QKkUQU4="; + rev = "f119398d868b1a3395f40c1df2e08b57b2c882cd"; + hash = "sha256-EfpKa5ZRBVM5T8EVim3cVX1PP1UM9CyG6tN5Br8zYww="; }; hardeningDisable = [ "pic" ]; @@ -34,12 +35,16 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - meta = with lib; { + meta = { description = "Realtek rtl8821ce driver"; homepage = "https://github.com/tomaspinho/rtl8821ce"; - license = licenses.gpl2Only; - platforms = platforms.linux; - maintainers = with maintainers; [ hhm ivar ]; - broken = stdenv.isAarch64 || ((lib.versions.majorMinor kernel.version) == "5.4" && kernel.isHardened); + license = lib.licenses.gpl2Only; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ + hhm + defelo + ]; + broken = + stdenv.isAarch64 || ((lib.versions.majorMinor kernel.version) == "5.4" && kernel.isHardened); }; -} +}) diff --git a/pkgs/os-specific/linux/sd-switch/default.nix b/pkgs/os-specific/linux/sd-switch/default.nix index b8dfd36d5919c..f14595d655be4 100644 --- a/pkgs/os-specific/linux/sd-switch/default.nix +++ b/pkgs/os-specific/linux/sd-switch/default.nix @@ -1,6 +1,6 @@ { lib, fetchFromSourcehut, rustPlatform, nix-update-script }: -let version = "0.5.0"; +let version = "0.5.1"; in rustPlatform.buildRustPackage { pname = "sd-switch"; inherit version; @@ -9,10 +9,10 @@ in rustPlatform.buildRustPackage { owner = "~rycee"; repo = "sd-switch"; rev = version; - hash = "sha256-TESS+CwwEugAz+grzndunAoKF9Or/Jl7tftL392fUaM="; + hash = "sha256-Kns49Qv3oWNmbLoLTKIcWIewDz4cR7uyMA3IHnhKyxA="; }; - cargoHash = "sha256-QEnleFwEIoKATupj0sSV/GUztQoozEsb3SEgnfFzAfw="; + cargoHash = "sha256-r20dJMF+0q3XLm2hn9/LTv43ApmhjJNgeiMCLfwBnOk="; passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/os-specific/linux/semodule-utils/default.nix b/pkgs/os-specific/linux/semodule-utils/default.nix index 126f927007cd8..ffc5639cf85c3 100644 --- a/pkgs/os-specific/linux/semodule-utils/default.nix +++ b/pkgs/os-specific/linux/semodule-utils/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "semodule-utils"; - version = "3.6"; + version = "3.7"; inherit (libsepol) se_url; src = fetchurl { url = "${se_url}/${version}/${pname}-${version}.tar.gz"; - sha256 = "sha256-7tuI8rISTlOPLWFL4GPA2aw+rMDFGk2kRQDKHtG6FvQ="; + sha256 = "sha256-2wZBrq/v7EZhLHwt3TPvEGC7chzmSELSqWwz3dtesXY="; }; buildInputs = [ libsepol ]; diff --git a/pkgs/os-specific/linux/sysdig/default.nix b/pkgs/os-specific/linux/sysdig/default.nix index ff149e771bcbf..1162b3363caee 100644 --- a/pkgs/os-specific/linux/sysdig/default.nix +++ b/pkgs/os-specific/linux/sysdig/default.nix @@ -1,13 +1,39 @@ -{ lib, stdenv, fetchFromGitHub, cmake, kernel, installShellFiles, pkg-config -, luajit, ncurses, perl, jsoncpp, openssl, curl, jq, gcc, elfutils, tbb -, protobuf, grpc, yaml-cpp, nlohmann_json, re2, zstd, uthash }: +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + kernel, + installShellFiles, + pkg-config, + luajit, + ncurses, + perl, + jsoncpp, + openssl, + curl, + jq, + gcc, + elfutils, + tbb, + protobuf, + grpc, + yaml-cpp, + nlohmann_json, + re2, + zstd, + uthash, + clang, + libbpf, + bpftools, +}: let - # Compare with https://github.com/draios/sysdig/blob/0.37.1/cmake/modules/falcosecurity-libs.cmake - libsRev = "0.16.0"; - libsHash = "sha256-aduO2pLj91tRdZ1dW1F1JFEg//SopialXWPd6Oav/u8="; + # Compare with https://github.com/draios/sysdig/blob/0.38.0/cmake/modules/falcosecurity-libs.cmake + libsRev = "0.17.2"; + libsHash = "sha256-BTLXtdU7GjOJReaycHvXkSd2vtybnCn0rTR7OEsvaMQ="; - # Compare with https://github.com/falcosecurity/libs/blob/0.16.0/cmake/modules/valijson.cmake + # Compare with https://github.com/falcosecurity/libs/blob/0.17.2/cmake/modules/valijson.cmake valijson = fetchFromGitHub { owner = "tristanpenman"; repo = "valijson"; @@ -15,16 +41,17 @@ let hash = "sha256-wvFdjsDtKH7CpbEpQjzWtLC4RVOU9+D2rSK0Xo1cJqo="; }; - # https://github.com/draios/sysdig/blob/0.37.1/cmake/modules/driver.cmake + # https://github.com/draios/sysdig/blob/0.38.0/cmake/modules/driver.cmake driver = fetchFromGitHub { owner = "falcosecurity"; repo = "libs"; - rev = "7.1.0+driver"; + rev = "7.2.0+driver"; hash = "sha256-FIlnJsNgofGo4HETEEpW28wpC3U9z5AZprwFR5AgFfA="; }; - version = "0.37.1"; -in stdenv.mkDerivation { + version = "0.38.0"; +in +stdenv.mkDerivation { pname = "sysdig"; inherit version; @@ -32,10 +59,15 @@ in stdenv.mkDerivation { owner = "draios"; repo = "sysdig"; rev = version; - hash = "sha256-V1rvQ6ZznL9UiUFW2lyW6gvdoGttOd5kgT2KPQCjmvQ="; + hash = "sha256-y6WArSz57w8vb3A3nHT37G6D8++6en2jQfeIS4YCD9U="; }; - nativeBuildInputs = [ cmake perl installShellFiles pkg-config ]; + nativeBuildInputs = [ + cmake + perl + installShellFiles + pkg-config + ]; buildInputs = [ luajit ncurses @@ -53,6 +85,9 @@ in stdenv.mkDerivation { nlohmann_json zstd uthash + clang + libbpf + bpftools ] ++ lib.optionals (kernel != null) kernel.moduleBuildDependencies; hardeningDisable = [ "pic" ]; @@ -97,48 +132,56 @@ in stdenv.mkDerivation { # fix compiler warnings been treated as errors "-Wno-error"; - preConfigure = '' - if ! grep -q "${libsRev}" cmake/modules/falcosecurity-libs.cmake; then - echo "falcosecurity-libs checksum needs to be updated!" - exit 1 - fi - cmakeFlagsArray+=(-DCMAKE_EXE_LINKER_FLAGS="-ltbb -lcurl -lzstd -labsl_synchronization") - '' + lib.optionalString (kernel != null) '' - export INSTALL_MOD_PATH="$out" - export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - ''; - - postInstall = '' - # Fix the bash completion location - installShellCompletion --bash $out/etc/bash_completion.d/sysdig - rm $out/etc/bash_completion.d/sysdig - rmdir $out/etc/bash_completion.d - rmdir $out/etc - '' + lib.optionalString (kernel != null) '' - make install_driver - kernel_dev=${kernel.dev} - kernel_dev=''${kernel_dev#${builtins.storeDir}/} - kernel_dev=''${kernel_dev%%-linux*dev*} - if test -f "$out/lib/modules/${kernel.modDirVersion}/extra/scap.ko"; then - sed -i "s#$kernel_dev#................................#g" $out/lib/modules/${kernel.modDirVersion}/extra/scap.ko - else - for i in $out/lib/modules/${kernel.modDirVersion}/{extra,updates}/scap.ko.xz; do - if test -f "$i"; then - xz -d $i - sed -i "s#$kernel_dev#................................#g" ''${i%.xz} - xz -9 ''${i%.xz} - fi - done - fi - ''; + preConfigure = + '' + if ! grep -q "${libsRev}" cmake/modules/falcosecurity-libs.cmake; then + echo "falcosecurity-libs checksum needs to be updated!" + exit 1 + fi + cmakeFlagsArray+=(-DCMAKE_EXE_LINKER_FLAGS="-ltbb -lcurl -lzstd -labsl_synchronization") + '' + + lib.optionalString (kernel != null) '' + export INSTALL_MOD_PATH="$out" + export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ''; + + postInstall = + '' + # Fix the bash completion location + installShellCompletion --bash $out/etc/bash_completion.d/sysdig + rm $out/etc/bash_completion.d/sysdig + rmdir $out/etc/bash_completion.d + rmdir $out/etc + '' + + lib.optionalString (kernel != null) '' + make install_driver + kernel_dev=${kernel.dev} + kernel_dev=''${kernel_dev#${builtins.storeDir}/} + kernel_dev=''${kernel_dev%%-linux*dev*} + if test -f "$out/lib/modules/${kernel.modDirVersion}/extra/scap.ko"; then + sed -i "s#$kernel_dev#................................#g" $out/lib/modules/${kernel.modDirVersion}/extra/scap.ko + else + for i in $out/lib/modules/${kernel.modDirVersion}/{extra,updates}/scap.ko.xz; do + if test -f "$i"; then + xz -d $i + sed -i "s#$kernel_dev#................................#g" ''${i%.xz} + xz -9 ''${i%.xz} + fi + done + fi + ''; meta = { - description = - "A tracepoint-based system tracing tool for Linux (with clients for other OSes)"; - license = with lib.licenses; [ asl20 gpl2Only mit ]; + description = "A tracepoint-based system tracing tool for Linux (with clients for other OSes)"; + license = with lib.licenses; [ + asl20 + gpl2Only + mit + ]; maintainers = with lib.maintainers; [ raskin ]; platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin; - broken = kernel != null && ((lib.versionOlder kernel.version "4.14") || kernel.isHardened || kernel.isZen); + broken = + kernel != null && ((lib.versionOlder kernel.version "4.14") || kernel.isHardened || kernel.isZen); homepage = "https://sysdig.com/opensource/"; downloadPage = "https://github.com/draios/sysdig/releases"; }; diff --git a/pkgs/os-specific/linux/system76-power/default.nix b/pkgs/os-specific/linux/system76-power/default.nix index 6a5456080f593..0dba9894d23e6 100644 --- a/pkgs/os-specific/linux/system76-power/default.nix +++ b/pkgs/os-specific/linux/system76-power/default.nix @@ -28,6 +28,6 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/pop-os/system76-power"; license = licenses.gpl3Plus; platforms = [ "i686-linux" "x86_64-linux" ]; - maintainers = [ maintainers.jwoudenberg ]; + maintainers = []; }; } diff --git a/pkgs/os-specific/linux/trace-cmd/kernelshark.nix b/pkgs/os-specific/linux/trace-cmd/kernelshark.nix index 211e03637d4ee..9f3d22c8a7077 100644 --- a/pkgs/os-specific/linux/trace-cmd/kernelshark.nix +++ b/pkgs/os-specific/linux/trace-cmd/kernelshark.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchzip, qtbase, qtscxml, cmake, asciidoc -, docbook_xsl, json_c, mesa_glu, freeglut, trace-cmd, pkg-config +, docbook_xsl, json_c, mesa_glu, libglut, trace-cmd, pkg-config , libtraceevent, libtracefs, freefont_ttf, wrapQtAppsHook, qtwayland }: @@ -16,7 +16,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config cmake wrapQtAppsHook ]; - buildInputs = [ qtbase qtscxml qtwayland json_c mesa_glu freeglut libtraceevent libtracefs trace-cmd ]; + buildInputs = [ qtbase qtscxml qtwayland json_c mesa_glu libglut libtraceevent libtracefs trace-cmd ]; cmakeFlags = [ "-D_INSTALL_PREFIX=${placeholder "out"}" diff --git a/pkgs/os-specific/linux/uhk-agent/default.nix b/pkgs/os-specific/linux/uhk-agent/default.nix index 553e471faaffa..8177c7d1efda6 100644 --- a/pkgs/os-specific/linux/uhk-agent/default.nix +++ b/pkgs/os-specific/linux/uhk-agent/default.nix @@ -21,8 +21,7 @@ let }; appimageContents = appimageTools.extract { - name = "${pname}-${version}"; - inherit src; + inherit pname version src; }; in stdenvNoCC.mkDerivation { diff --git a/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix b/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix index ad983662109a7..f428ef803b1a7 100644 --- a/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix +++ b/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix @@ -34,6 +34,6 @@ mkDerivation rec { sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; license = licenses.unfree; platforms = [ "x86_64-linux" ]; - maintainers = with maintainers; [ ivar ]; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/os-specific/windows/mingw-w64/default.nix b/pkgs/os-specific/windows/mingw-w64/default.nix index ba2b243a9408a..36cdaf84aab61 100644 --- a/pkgs/os-specific/windows/mingw-w64/default.nix +++ b/pkgs/os-specific/windows/mingw-w64/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , windows -, fetchurl , autoreconfHook , mingw_w64_headers }: |