From da9c1825bc49c2580f08b3a3d88db79bdbc63539 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Wed, 1 May 2024 09:37:04 -0700 Subject: [PATCH] freebsd/{pkgs,patches}: Move patches to version-dependent patches dir --- pkgs/os-specific/bsd/freebsd/package-set.nix | 4 ++-- .../13.1}/compat-fix-typedefs-locations.patch | 0 .../compat => patches/13.1}/compat-install-dirs.patch | 0 .../libc => patches/13.1}/libc-msun-arch-subdir.patch | 0 .../13.1}/libc-no-force--lcompiler-rt.patch | 0 .../libnetbsd => patches/13.1}/libnetbsd-do-install.patch | 0 .../libc => patches/13.1}/librpcsvc-include-subdir.patch | 0 .../13.1}/no-perms-BSD.include.dist.patch | 0 .../{pkgs/rpcgen => patches/13.1}/rpcgen-glibc-hack.patch | 0 .../freebsd/{pkgs/sys => patches/13.1}/sys-gnu-date.patch | 0 .../13.1}/sys-no-explicit-intrinsics-dep.patch | 0 pkgs/os-specific/bsd/freebsd/pkgs/compat/package.nix | 6 +++--- pkgs/os-specific/bsd/freebsd/pkgs/include/package.nix | 4 ++-- pkgs/os-specific/bsd/freebsd/pkgs/libc/package.nix | 7 ++++--- pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix | 6 +++--- pkgs/os-specific/bsd/freebsd/pkgs/rpcgen/package.nix | 6 +++--- pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix | 6 +++--- pkgs/os-specific/bsd/freebsd/versions.nix | 1 + 18 files changed, 21 insertions(+), 19 deletions(-) rename pkgs/os-specific/bsd/freebsd/{pkgs/compat => patches/13.1}/compat-fix-typedefs-locations.patch (100%) rename pkgs/os-specific/bsd/freebsd/{pkgs/compat => patches/13.1}/compat-install-dirs.patch (100%) rename pkgs/os-specific/bsd/freebsd/{pkgs/libc => patches/13.1}/libc-msun-arch-subdir.patch (100%) rename pkgs/os-specific/bsd/freebsd/{pkgs/libc => patches/13.1}/libc-no-force--lcompiler-rt.patch (100%) rename pkgs/os-specific/bsd/freebsd/{pkgs/libnetbsd => patches/13.1}/libnetbsd-do-install.patch (100%) rename pkgs/os-specific/bsd/freebsd/{pkgs/libc => patches/13.1}/librpcsvc-include-subdir.patch (100%) rename pkgs/os-specific/bsd/freebsd/{pkgs/include => patches/13.1}/no-perms-BSD.include.dist.patch (100%) rename pkgs/os-specific/bsd/freebsd/{pkgs/rpcgen => patches/13.1}/rpcgen-glibc-hack.patch (100%) rename pkgs/os-specific/bsd/freebsd/{pkgs/sys => patches/13.1}/sys-gnu-date.patch (100%) rename pkgs/os-specific/bsd/freebsd/{pkgs/sys => patches/13.1}/sys-no-explicit-intrinsics-dep.patch (100%) diff --git a/pkgs/os-specific/bsd/freebsd/package-set.nix b/pkgs/os-specific/bsd/freebsd/package-set.nix index 363e6693b93e..609b3f45b51e 100644 --- a/pkgs/os-specific/bsd/freebsd/package-set.nix +++ b/pkgs/os-specific/bsd/freebsd/package-set.nix @@ -1,6 +1,6 @@ { stdenv, lib, stdenvNoCC , fetchzip -, sourceData, versionData, buildFreebsd +, sourceData, versionData, buildFreebsd, patchesRoot }: self: @@ -9,7 +9,7 @@ lib.packagesFromDirectoryRecursive { callPackage = self.callPackage; directory = ./pkgs; } // { - inherit sourceData versionData; + inherit sourceData patchesRoot versionData; # Keep the crawled portion of Nixpkgs finite. buildFreebsd = lib.dontRecurseIntoAttrs buildFreebsd; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/compat/compat-fix-typedefs-locations.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/compat-fix-typedefs-locations.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/compat/compat-fix-typedefs-locations.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/compat-fix-typedefs-locations.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/compat/compat-install-dirs.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/compat-install-dirs.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/compat/compat-install-dirs.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/compat-install-dirs.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libc/libc-msun-arch-subdir.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/libc-msun-arch-subdir.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/libc/libc-msun-arch-subdir.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/libc-msun-arch-subdir.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libc/libc-no-force--lcompiler-rt.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/libc-no-force--lcompiler-rt.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/libc/libc-no-force--lcompiler-rt.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/libc-no-force--lcompiler-rt.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/libnetbsd-do-install.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/libnetbsd-do-install.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/libnetbsd-do-install.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/libnetbsd-do-install.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libc/librpcsvc-include-subdir.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/librpcsvc-include-subdir.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/libc/librpcsvc-include-subdir.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/librpcsvc-include-subdir.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/include/no-perms-BSD.include.dist.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/no-perms-BSD.include.dist.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/include/no-perms-BSD.include.dist.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/no-perms-BSD.include.dist.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/rpcgen/rpcgen-glibc-hack.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/rpcgen-glibc-hack.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/rpcgen/rpcgen-glibc-hack.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/rpcgen-glibc-hack.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-gnu-date.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/sys-gnu-date.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-gnu-date.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/sys-gnu-date.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-no-explicit-intrinsics-dep.patch b/pkgs/os-specific/bsd/freebsd/patches/13.1/sys-no-explicit-intrinsics-dep.patch similarity index 100% rename from pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-no-explicit-intrinsics-dep.patch rename to pkgs/os-specific/bsd/freebsd/patches/13.1/sys-no-explicit-intrinsics-dep.patch diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/compat/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/compat/package.nix index 5e4528fbf46a..d31e3b05427b 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/compat/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/compat/package.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, mkDerivation +{ lib, stdenv, mkDerivation, patchesRoot , bsdSetupHook, freebsdSetupHook , makeMinimal, boot-install , which @@ -85,8 +85,8 @@ mkDerivation rec { ]; patches = [ - ./compat-install-dirs.patch - ./compat-fix-typedefs-locations.patch + /${patchesRoot}/compat-install-dirs.patch + /${patchesRoot}/compat-fix-typedefs-locations.patch ]; preBuild = '' diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/include/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/include/package.nix index 73fa887c5123..5c6f3ac4a16b 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/include/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/include/package.nix @@ -1,4 +1,4 @@ -{ lib, mkDerivation +{ lib, mkDerivation, patchesRoot , buildPackages , bsdSetupHook, freebsdSetupHook , makeMinimal @@ -26,7 +26,7 @@ mkDerivation { ]; patches = [ - ./no-perms-BSD.include.dist.patch + /${patchesRoot}/no-perms-BSD.include.dist.patch ]; # The makefiles define INCSDIR per subdirectory, so we have to set diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libc/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libc/package.nix index 0225d44be4c3..935b48cca5e7 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libc/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libc/package.nix @@ -1,4 +1,5 @@ { lib, stdenv, mkDerivation +, patchesRoot , bsdSetupHook, freebsdSetupHook , makeMinimal @@ -48,13 +49,13 @@ mkDerivation rec { patches = [ # Hack around broken propogating MAKEFLAGS to submake, just inline logic - ./libc-msun-arch-subdir.patch + /${patchesRoot}/libc-msun-arch-subdir.patch # Don't force -lcompiler-rt, we don't actually call it that - ./libc-no-force--lcompiler-rt.patch + /${patchesRoot}/libc-no-force--lcompiler-rt.patch # Fix extra include dir to get rpcsvc headers. - ./librpcsvc-include-subdir.patch + /${patchesRoot}/librpcsvc-include-subdir.patch ]; postPatch = '' diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix index 4011e4d8a649..0deea8b2fb7b 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix @@ -1,5 +1,5 @@ { lib, stdenv -, mkDerivation +, mkDerivation, patchesRoot , bsdSetupHook, freebsdSetupHook, makeMinimal, mandoc, groff , boot-install, install , compatIfNeeded @@ -15,8 +15,8 @@ mkDerivation { else install) ]; patches = lib.optionals (!stdenv.hostPlatform.isFreeBSD) [ - ./libnetbsd-do-install.patch - #./libnetbsd-define-__va_list.patch + /${patchesRoot}/libnetbsd-do-install.patch + #/${patchesRoot}/libnetbsd-define-__va_list.patch ]; makeFlags = [ "STRIP=-s" # flag to install, not command diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/rpcgen/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/rpcgen/package.nix index 56141255af5e..c2e64cb36601 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/rpcgen/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/rpcgen/package.nix @@ -1,4 +1,4 @@ -{ lib, mkDerivation, stdenv }: +{ lib, mkDerivation, stdenv, patchesRoot }: mkDerivation rec { path = "usr.bin/rpcgen"; @@ -12,11 +12,11 @@ mkDerivation rec { # those headers ends up included other headers...which ends up # including the other one, this means by the first time we reach # `#include ``, both `_SYS_WAIT_H` and - # `_STDLIB_H` are already defined! Thus, we never ned up including + # `_STDLIB_H` are already defined! Thus, we never end up including # `` and defining `WUNTRACED`. # # This hacks around this by manually including `WUNTRACED` until # the problem is fixed properly in glibc. - ./rpcgen-glibc-hack.patch + /${patchesRoot}/rpcgen-glibc-hack.patch ]; } diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix index 81cf4114e873..ab0edbabceab 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, mkDerivation, freebsd-lib +{ stdenv, mkDerivation, freebsd-lib, patchesRoot , buildPackages , bsdSetupHook, freebsdSetupHook , makeMinimal, install, mandoc, groff @@ -19,8 +19,8 @@ in rec { ]; patches = [ - ./sys-gnu-date.patch - ./sys-no-explicit-intrinsics-dep.patch + /${patchesRoot}/sys-gnu-date.patch + /${patchesRoot}/sys-no-explicit-intrinsics-dep.patch ]; # --dynamic-linker /red/herring is used when building the kernel. diff --git a/pkgs/os-specific/bsd/freebsd/versions.nix b/pkgs/os-specific/bsd/freebsd/versions.nix index 4acfd5b6198b..e49396795e2d 100644 --- a/pkgs/os-specific/bsd/freebsd/versions.nix +++ b/pkgs/os-specific/bsd/freebsd/versions.nix @@ -33,6 +33,7 @@ let buildFreebsd = otherSplices.selfBuildHost; inherit sourceData; versionData = sourceData.version; + patchesRoot = ./patches/${sourceData.version.revision}; } // extraArgs );