···729729 <title>Variables controlling the patch phase</title>
730730 <varlistentry>
731731 <term>
732732+ <varname>dontPatch</varname>
733733+ </term>
734734+ <listitem>
735735+ <para>
736736+ Set to true to skip the patch phase.
737737+ </para>
738738+ </listitem>
739739+ </varlistentry>
740740+ <varlistentry>
741741+ <term>
732742 <varname>patches</varname>
733743 </term>
734744 <listitem>
+5
nixos/modules/config/fonts/fontconfig.nix
···45454646 # generate the font cache setting file for a fontconfig version
4747 # use latest when no version is passed
4848+ # When cross-compiling, we can’t generate the cache, so we skip the
4949+ # <cachedir> part. fontconfig still works but is a little slower in
5050+ # looking things up.
4851 makeCacheConf = { version ? null }:
4952 let
5053 fcPackage = if version == null
···6063 <fontconfig>
6164 <!-- Font directories -->
6265 ${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
6666+ ${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
6367 <!-- Pre-generated font caches -->
6468 <cachedir>${cache}</cachedir>
6569 ${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) ''
6670 <cachedir>${cache32}</cachedir>
7171+ ''}
6772 ''}
6873 </fontconfig>
6974 '';
···1919 continue
2020 fi
2121 GDK_PIXBUF_MODULEDIR="$module_dir" \
2222- ${pkgs.gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders
2222+ ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} ${pkgs.gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders
2323 done
2424 ) > "$out"
2525 '';
···3737 # If there is any package configured in modulePackages, we generate the
3838 # loaders.cache based on that and set the environment variable
3939 # GDK_PIXBUF_MODULE_FILE to point to it.
4040- config = mkIf (cfg.modulePackages != []) {
4040+ config = mkIf (cfg.modulePackages != [] || pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform) {
4141 environment.variables = {
4242 GDK_PIXBUF_MODULE_FILE = "${loadersCache}";
4343 };
···11+#! @shell@
22+set -eu -o pipefail +o posix
33+shopt -s nullglob
44+55+if (( "${NIX_DEBUG:-0}" >= 7 )); then
66+ set -x
77+fi
88+99+path_backup="$PATH"
1010+1111+# That @-vars are substituted separately from bash evaluation makes
1212+# shellcheck think this, and others like it, are useless conditionals.
1313+# shellcheck disable=SC2157
1414+if [[ -n "@coreutils_bin@" && -n "@gnugrep_bin@" ]]; then
1515+ PATH="@coreutils_bin@/bin:@gnugrep_bin@/bin"
1616+fi
1717+1818+source @out@/nix-support/utils.bash
1919+2020+# Flirting with a layer violation here.
2121+if [ -z "${NIX_BINTOOLS_WRAPPER_@infixSalt@_FLAGS_SET:-}" ]; then
2222+ source @bintools@/nix-support/add-flags.sh
2323+fi
2424+2525+# Put this one second so libc ldflags take priority.
2626+if [ -z "${NIX_CC_WRAPPER_@infixSalt@_FLAGS_SET:-}" ]; then
2727+ source @out@/nix-support/add-flags.sh
2828+fi
2929+3030+3131+# Parse command line options and set several variables.
3232+# For instance, figure out if linker flags should be passed.
3333+# GCC prints annoying warnings when they are not needed.
3434+dontLink=0
3535+nonFlagArgs=0
3636+# shellcheck disable=SC2193
3737+3838+expandResponseParams "$@"
3939+declare -i n=0
4040+nParams=${#params[@]}
4141+while (( "$n" < "$nParams" )); do
4242+ p=${params[n]}
4343+ p2=${params[n+1]:-} # handle `p` being last one
4444+ if [ "$p" = -c ]; then
4545+ dontLink=1
4646+ elif [ "$p" = -S ]; then
4747+ dontLink=1
4848+ elif [ "$p" = -E ]; then
4949+ dontLink=1
5050+ elif [ "$p" = -E ]; then
5151+ dontLink=1
5252+ elif [ "$p" = -M ]; then
5353+ dontLink=1
5454+ elif [ "$p" = -MM ]; then
5555+ dontLink=1
5656+ elif [[ "$p" = -x && "$p2" = *-header ]]; then
5757+ dontLink=1
5858+ elif [[ "$p" != -?* ]]; then
5959+ # A dash alone signifies standard input; it is not a flag
6060+ nonFlagArgs=1
6161+ fi
6262+ n+=1
6363+done
6464+6565+# If we pass a flag like -Wl, then gcc will call the linker unless it
6666+# can figure out that it has to do something else (e.g., because of a
6767+# "-c" flag). So if no non-flag arguments are given, don't pass any
6868+# linker flags. This catches cases like "gcc" (should just print
6969+# "gcc: no input files") and "gcc -v" (should print the version).
7070+if [ "$nonFlagArgs" = 0 ]; then
7171+ dontLink=1
7272+fi
7373+7474+# Optionally filter out paths not refering to the store.
7575+if [[ "${NIX_ENFORCE_PURITY:-}" = 1 && -n "$NIX_STORE" ]]; then
7676+ rest=()
7777+ nParams=${#params[@]}
7878+ declare -i n=0
7979+ while (( "$n" < "$nParams" )); do
8080+ p=${params[n]}
8181+ p2=${params[n+1]:-} # handle `p` being last one
8282+ if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then
8383+ skip "${p:2}"
8484+ elif [ "$p" = -L ] && badPath "$p2"; then
8585+ n+=1; skip "$p2"
8686+ elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then
8787+ skip "${p:2}"
8888+ elif [ "$p" = -I ] && badPath "$p2"; then
8989+ n+=1; skip "$p2"
9090+ elif [ "${p:0:4}" = -aI/ ] && badPath "${p:3}"; then
9191+ skip "${p:3}"
9292+ elif [ "$p" = -aI ] && badPath "$p2"; then
9393+ n+=1; skip "$p2"
9494+ elif [ "${p:0:4}" = -aO/ ] && badPath "${p:3}"; then
9595+ skip "${p:3}"
9696+ elif [ "$p" = -aO ] && badPath "$p2"; then
9797+ n+=1; skip "$p2"
9898+ elif [ "$p" = -isystem ] && badPath "$p2"; then
9999+ n+=1; skip "$p2"
100100+ else
101101+ rest+=("$p")
102102+ fi
103103+ n+=1
104104+ done
105105+ # Old bash empty array hack
106106+ params=(${rest+"${rest[@]}"})
107107+fi
108108+109109+110110+# Clear march/mtune=native -- they bring impurity.
111111+if [ "$NIX_@infixSalt@_ENFORCE_NO_NATIVE" = 1 ]; then
112112+ rest=()
113113+ # Old bash empty array hack
114114+ for p in ${params+"${params[@]}"}; do
115115+ if [[ "$p" = -m*=native ]]; then
116116+ skip "$p"
117117+ else
118118+ rest+=("$p")
119119+ fi
120120+ done
121121+ # Old bash empty array hack
122122+ params=(${rest+"${rest[@]}"})
123123+fi
124124+125125+if [ "$(basename $0)x" = "gnatmakex" ]; then
126126+ extraBefore=("--GNATBIND=@out@/bin/gnatbind" "--GNATLINK=@out@/bin/gnatlink")
127127+ extraAfter=($NIX_@infixSalt@_GNATFLAGS_COMPILE)
128128+fi
129129+130130+if [ "$(basename $0)x" = "gnatbindx" ]; then
131131+ extraBefore=()
132132+ extraAfter=($NIX_@infixSalt@_GNATFLAGS_COMPILE)
133133+fi
134134+135135+if [ "$(basename $0)x" = "gnatlinkx" ]; then
136136+ extraBefore=()
137137+ extraAfter=("--GCC=@out@/bin/gcc")
138138+fi
139139+140140+# As a very special hack, if the arguments are just `-v', then don't
141141+# add anything. This is to prevent `gcc -v' (which normally prints
142142+# out the version number and returns exit code 0) from printing out
143143+# `No input files specified' and returning exit code 1.
144144+if [ "$*" = -v ]; then
145145+ extraAfter=()
146146+ extraBefore=()
147147+fi
148148+149149+# Optionally print debug info.
150150+if (( "${NIX_DEBUG:-0}" >= 1 )); then
151151+ # Old bash workaround, see ld-wrapper for explanation.
152152+ echo "extra flags before to @prog@:" >&2
153153+ printf " %q\n" ${extraBefore+"${extraBefore[@]}"} >&2
154154+ echo "original flags to @prog@:" >&2
155155+ printf " %q\n" ${params+"${params[@]}"} >&2
156156+ echo "extra flags after to @prog@:" >&2
157157+ printf " %q\n" ${extraAfter+"${extraAfter[@]}"} >&2
158158+fi
159159+160160+PATH="$path_backup"
161161+# Old bash workaround, see above.
162162+exec @prog@ \
163163+ ${extraBefore+"${extraBefore[@]}"} \
164164+ ${params+"${params[@]}"} \
165165+ ${extraAfter+"${extraAfter[@]}"}
+2-2
pkgs/build-support/setup-hooks/auto-patchelf.sh
···1515 # *or* there is an INTERP section. This also catches position-independent
1616 # executables, as they typically have an INTERP section but their ELF type
1717 # is DYN.
1818- isExeResult="$(LANG=C readelf -h -l "$1" 2> /dev/null \
1818+ isExeResult="$(LANG=C $READELF -h -l "$1" 2> /dev/null \
1919 | grep '^ *Type: *EXEC\>\|^ *INTERP\>')"
2020 # not using grep -q, because it can cause Broken pipe
2121 [ -n "$isExeResult" ]
···207207 # outside of this function.
208208 while IFS= read -r -d $'\0' file; do
209209 isELF "$file" || continue
210210- segmentHeaders="$(LANG=C readelf -l "$file")"
210210+ segmentHeaders="$(LANG=C $READELF -l "$file")"
211211 # Skip if the ELF file doesn't have segment headers (eg. object files).
212212 # not using grep -q, because it can cause Broken pipe
213213 [ -n "$(echo "$segmentHeaders" | grep '^Program Headers:')" ] || continue
+1-1
pkgs/data/icons/hicolor-icon-theme/setup-hook.sh
···1010}
11111212# I think this is meant to be a runtime dep
1313-addEnvHooks "${hostOffset:?}" hicolorIconThemeHook
1313+addEnvHooks "${targetOffset:?}" hicolorIconThemeHook
···65656666 # Install bash-completions to correct prefix.
6767 # https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1194
6868- ./fix-bash-completion.patch
6868+ (fetchpatch {
6969+ url = "https://gitlab.gnome.org/GNOME/gnome-shell/commit/9f1ad5d86ddbabaa840eb2860279d53f4e635453.patch";
7070+ sha256 = "f8MDFbfg9D7ORF84Ld9GIvf0xRCYuSszo3QLMji2VaE=";
7171+ })
69727073 # Use absolute path for libshew installation to make our patched gobject-introspection
7174 # aware of the location to hardcode in the generated GIR file.
···11+diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
22+index 4e74252bd74..0d848b5b4e3 100644
33+--- a/gcc/ada/gcc-interface/Makefile.in
44++++ b/gcc/ada/gcc-interface/Makefile.in
55+@@ -111,7 +111,7 @@ NO_OMIT_ADAFLAGS = -fno-omit-frame-pointer
66+ NO_SIBLING_ADAFLAGS = -fno-optimize-sibling-calls
77+ NO_REORDER_ADAFLAGS = -fno-toplevel-reorder
88+ GNATLIBFLAGS = -W -Wall -gnatpg -nostdinc
99+-GNATLIBCFLAGS = -g -O2
1010++GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET)
1111+ # Pretend that _Unwind_GetIPInfo is available for the target by default. This
1212+ # should be autodetected during the configuration of libada and passed down to
1313+ # here, but we need something for --disable-libada and hope for the best.
1414+@@ -198,7 +198,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
1515+ # Link flags used to build gnat tools. By default we prefer to statically
1616+ # link with libgcc to avoid a dependency on shared libgcc (which is tricky
1717+ # to deal with as it may conflict with the libgcc provided by the system).
1818+-GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc
1919++GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc $(CFLAGS_FOR_TARGET)
2020+2121+ # End of variables for you to override.
2222+2323+diff --git a/libada/Makefile.in b/libada/Makefile.in
2424+index 522b9207326..ca866c74471 100644
2525+--- a/libada/Makefile.in
2626++++ b/libada/Makefile.in
2727+@@ -59,7 +59,7 @@ LDFLAGS=
2828+ CFLAGS=-g
2929+ PICFLAG = @PICFLAG@
3030+ GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
3131+-GNATLIBCFLAGS= -g -O2
3232++GNATLIBCFLAGS= -g -O2 $(CFLAGS)
3333+ GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
3434+ -fexceptions -DIN_RTS @have_getipinfo@ @have_capability@
3535+
···11-21make_glib_find_gsettings_schemas() {
32 # For packages that need gschemas of other packages (e.g. empathy)
43 for maybe_dir in "$1"/share/gsettings-schemas/*; do
···76 fi
87 done
98}
1010-addEnvHooks "$hostOffset" make_glib_find_gsettings_schemas
99+addEnvHooks "$targetOffset" make_glib_find_gsettings_schemas
11101211# Install gschemas, if any, in a package-specific directory
1312glibPreInstallPhase() {
···73737474 # https://gitlab.gnome.org/GNOME/gtk/merge_requests/1002
7575 ./patches/01-build-Fix-path-handling-in-pkgconfig.patch
7676+7777+ # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1634
7878+ (fetchpatch {
7979+ url = "https://gitlab.gnome.org/GNOME/gtk/-/commit/79732da1ed8cb167440fb047c72cfc0d888a187b.patch";
8080+ sha256 = "1ynrx81dkwjfqhvg80q28qbb6jabg4x73fkbrnligzgkzimfjpx3";
8181+ })
8282+ # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1633
8383+ (fetchpatch {
8484+ url = "https://gitlab.gnome.org/GNOME/gtk/-/commit/12fc9a45efcbb546eb7de13c5c4d3183f2f5a3b8.patch";
8585+ sha256 = "00zrm77qk39p1hgn207az82cgvqiyp6is7dk0ssjxkc34403r78v";
8686+ })
8787+ (fetchpatch {
8888+ url = "https://gitlab.gnome.org/GNOME/gtk/-/commit/5a52af20cba76474e631b2a7548963bcad22d66d.patch";
8989+ sha256 = "0sbzzwa0si1w83m5abyf312f4w445wwlms53m5hb7kdgkjbhaa3f";
9090+ })
7691 ] ++ optionals stdenv.isDarwin [
7792 # X11 module requires <gio/gdesktopappinfo.h> which is not installed on Darwin
7893 # let’s drop that dependency in similar way to how other parts of the library do it
+5
pkgs/development/libraries/libasyncns/default.nix
···88 sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg";
99 };
10101111+ configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
1212+ "ac_cv_func_malloc_0_nonnull=yes"
1313+ "ac_cv_func_realloc_0_nonnull=yes"
1414+ ];
1515+1116 meta = with stdenv.lib; {
1217 homepage = "http://0pointer.de/lennart/projects/libasyncns/";
1318 description = "A C library for Linux/Unix for executing name service queries asynchronously";
+5
pkgs/development/libraries/libcddb/default.nix
···10101111 buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv;
12121313+ configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
1414+ "ac_cv_func_malloc_0_nonnull=yes"
1515+ "ac_cv_func_realloc_0_nonnull=yes"
1616+ ];
1717+1318 doCheck = false; # fails 3 of 5 tests with locale errors
14191520 meta = with stdenv.lib; {
···135135 experimentalFpMbStatsSupport ||
136136 experimentalEmulateHardwareSupport) "experimental")
137137 ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
138138- #"--extra-cflags="
139139- #"--extra-cxxflags="
140140- #"--prefix="
141141- #"--libc="
142142- #"--libdir="
143143- "--enable-external-build"
144138 # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version)
145139 # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure
146140 # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14
147147- "--force-target=${stdenv.hostPlatform.config}${
141141+ "--force-target=${stdenv.hostPlatform.parsed.cpu.name}-${stdenv.hostPlatform.parsed.kernel.name}${
148142 if stdenv.hostPlatform.isDarwin then
149143 if stdenv.hostPlatform.osxMinVersion == "10.10" then "14"
150144 else if stdenv.hostPlatform.osxMinVersion == "10.9" then "13"
···11+From e996904128653c67b04ddbdb1e10cef158098957 Mon Sep 17 00:00:00 2001
22+From: Samuel Dionne-Riel <samuel@dionne-riel.com>
33+Date: Fri, 6 Dec 2019 23:00:51 -0500
44+Subject: [PATCH] [HACK]: Assumes Expat paths are good.
55+66+The `check_lib` check fails with the cross-compilation build platform's
77+Perl, since apparently `mktemp` is missing...
88+99+Even then, side-stepping the issue, it seems it is not actually enough
1010+to work, as the compilation fails.
1111+---
1212+ Makefile.PL | 17 +++++++++++------
1313+ 1 file changed, 11 insertions(+), 6 deletions(-)
1414+1515+diff --git a/Makefile.PL b/Makefile.PL
1616+index 505d1df..fc38b76 100644
1717+--- a/Makefile.PL
1818++++ b/Makefile.PL
1919+@@ -29,12 +29,17 @@ foreach (@ARGV) {
2020+ @ARGV = @replacement_args;
2121+2222+ unless (
2323+- check_lib( # fill in what you prompted the user for here
2424+- lib => [qw(expat)],
2525+- header => ['expat.h'],
2626+- incpath => $expat_incpath,
2727+- ( $expat_libpath ? ( libpath => $expat_libpath ) : () ),
2828+- )
2929++ #check_lib( # fill in what you prompted the user for here
3030++ # lib => [qw(expat)],
3131++ # header => ['expat.h'],
3232++ # incpath => $expat_incpath,
3333++ # ( $expat_libpath ? ( libpath => $expat_libpath ) : () ),
3434++ #)
3535++ # The check_lib implementation fails horribly with cross-compilation.
3636++ # We are giving known good paths to expat.
3737++ # And in all cases, the previous behaviour of not actually failing
3838++ # seemed to work just fine :/.
3939++ false
4040+ ) {
4141+ warn <<'Expat_Not_Installed;';
4242+4343+--
4444+2.23.0
4545+
···11--- a/mesonbuild/coredata.py
22+++ b/mesonbuild/coredata.py
33-@@ -375,18 +375,13 @@
44- '''
55- if option.endswith('dir') and os.path.isabs(value) and \
33+@@ -483,7 +483,6 @@ class CoreData:
44+ return value
55+ if option.endswith('dir') and value.is_absolute() and \
66 option not in builtin_dir_noprefix_options:
77- # Value must be a subdir of the prefix
88 # commonpath will always return a path in the native format, so we
99 # must use pathlib.PurePath to do the same conversion before
1010 # comparing.
1111-- if os.path.commonpath([value, prefix]) != str(PurePath(prefix)):
1212-- m = 'The value of the {!r} option is {!r} which must be a ' \
1313-- 'subdir of the prefix {!r}.\nNote that if you pass a ' \
1414-- 'relative path, it is assumed to be a subdir of prefix.'
1515-- raise MesonException(m.format(option, value, prefix))
1616-- # Convert path to be relative to prefix
1717-- skip = len(prefix) + 1
1818-- value = value[skip:]
1919-+ if os.path.commonpath([value, prefix]) == str(PurePath(prefix)):
2020-+ # Convert path to be relative to prefix
2121-+ skip = len(prefix) + 1
2222-+ value = value[skip:]
2323- return value
2424-2525- def init_builtins(self):
1111+@@ -495,7 +494,7 @@ class CoreData:
1212+ try:
1313+ value = value.relative_to(prefix)
1414+ except ValueError:
1515+- raise MesonException(msg.format(option, value, prefix))
1616++ pass
1717+ if '..' in str(value):
1818+ raise MesonException(msg.format(option, value, prefix))
1919+ return value.as_posix()
···11+From a6c9317a905ef478b8e0d3dad263990feb5d11cb Mon Sep 17 00:00:00 2001
22+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
33+Date: Tue, 8 Jan 2013 15:46:30 +0100
44+Subject: [PATCH 01/27] Start device units for uninitialised encrypted devices
55+66+This is necessary because the NixOS service that initialises the
77+filesystem depends on the appearance of the device unit. Also, this
88+makes more sense to me: the device is ready; it's the filesystem
99+that's not, but taking care of that is the responsibility of the mount
1010+unit. (However, this ignores the fsck unit, so it's not perfect...)
1111+---
1212+ rules.d/99-systemd.rules.in | 4 ----
1313+ 1 file changed, 4 deletions(-)
1414+1515+diff --git a/rules.d/99-systemd.rules.in b/rules.d/99-systemd.rules.in
1616+index c34b606216..3ab8c1c3fe 100644
1717+--- a/rules.d/99-systemd.rules.in
1818++++ b/rules.d/99-systemd.rules.in
1919+@@ -17,10 +17,6 @@ SUBSYSTEM=="ubi", TAG+="systemd"
2020+ SUBSYSTEM=="block", TAG+="systemd"
2121+ SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
2222+2323+-# Ignore encrypted devices with no identified superblock on it, since
2424+-# we are probably still calling mke2fs or mkswap on it.
2525+-SUBSYSTEM=="block", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
2626+-
2727+ # add symlink to GPT root disk
2828+ SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}!="crypto_LUKS", SYMLINK+="gpt-auto-root"
2929+ SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}=="crypto_LUKS", SYMLINK+="gpt-auto-root-luks"
3030+--
3131+2.24.1
3232+
···11+From 3eb1716dd80c245a2883da04156af79fb9097519 Mon Sep 17 00:00:00 2001
22+From: Andreas Rammhold <andreas@rammhold.de>
33+Date: Fri, 2 Nov 2018 21:15:42 +0100
44+Subject: [PATCH 19/27] inherit systemd environment when calling generators.
55+66+Systemd generators need access to the environment configured in
77+stage-2-init.sh since it schedules fsck and mkfs executions based on
88+being able to find an appropriate binary for the target filesystem.
99+1010+With this commit I am altering the systemd behaviour since upstream
1111+tries to gather environments with that they call
1212+"environment-generators" and then seems to pass that on to all the other
1313+executables that are being called from managers.
1414+---
1515+ src/core/manager.c | 11 ++++++++---
1616+ 1 file changed, 8 insertions(+), 3 deletions(-)
1717+1818+diff --git a/src/core/manager.c b/src/core/manager.c
1919+index d9114bb0c5..22c3b6ff76 100644
2020+--- a/src/core/manager.c
2121++++ b/src/core/manager.c
2222+@@ -3868,9 +3868,14 @@ static int manager_run_generators(Manager *m) {
2323+ argv[4] = NULL;
2424+2525+ RUN_WITH_UMASK(0022)
2626+- (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC, NULL, NULL,
2727+- (char**) argv, m->transient_environment, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
2828+-
2929++ (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC,
3030++ // On NixOS we must propagate PATH to generators so they are
3131++ // able to find binaries such as `fsck.${fstype}` and
3232++ // `mkfs.${fstype}`. That is why the last argument of the
3333++ // function (envp) is set to NULL. This propagates systemd's
3434++ // environment (e.g. PATH) that was setup
3535++ // before calling systemd from stage-2-init.sh.
3636++ NULL, NULL, (char**) argv, /* NixOS: use inherited env */ NULL, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
3737+ r = 0;
3838+3939+ finish:
4040+--
4141+2.24.1
4242+
···11+From 8d1618a97ad08078815f409f03b45aff3ae6bd0a Mon Sep 17 00:00:00 2001
22+From: Andreas Rammhold <andreas@rammhold.de>
33+Date: Thu, 9 May 2019 11:15:22 +0200
44+Subject: [PATCH 21/27] add rootprefix to lookup dir paths
55+66+systemd does not longer use the UDEVLIBEXEC directory as root for
77+discovery default udev rules. By adding `$out/lib` to the lookup paths
88+we should again be able to discover the udev rules amongst other default
99+files that I might have missed.
1010+---
1111+ src/basic/def.h | 6 ++++--
1212+ 1 file changed, 4 insertions(+), 2 deletions(-)
1313+1414+diff --git a/src/basic/def.h b/src/basic/def.h
1515+index 2af0b763f0..17959b07e8 100644
1616+--- a/src/basic/def.h
1717++++ b/src/basic/def.h
1818+@@ -39,13 +39,15 @@
1919+ "/run/" n "\0" \
2020+ "/usr/local/lib/" n "\0" \
2121+ "/usr/lib/" n "\0" \
2222+- _CONF_PATHS_SPLIT_USR_NULSTR(n)
2323++ _CONF_PATHS_SPLIT_USR_NULSTR(n) \
2424++ ROOTPREFIX "/lib/" n "\0"
2525+2626+ #define CONF_PATHS_USR(n) \
2727+ "/etc/" n, \
2828+ "/run/" n, \
2929+ "/usr/local/lib/" n, \
3030+- "/usr/lib/" n
3131++ "/usr/lib/" n, \
3232++ ROOTPREFIX "/lib/" n
3333+3434+ #define CONF_PATHS(n) \
3535+ CONF_PATHS_USR(n) \
3636+--
3737+2.24.1
3838+
···11{ stdenv, fetchFromGitHub
22, fetchpatch
33, autoreconfHook
44+, perl
55+, ps
46, python3Packages
57, bashInteractive
68}:
79810stdenv.mkDerivation rec {
911 pname = "bash-completion";
1010- # TODO: Remove musl patch below upon next release!
1111- version = "2.9";
1212+ version = "2.10";
12131314 src = fetchFromGitHub {
1415 owner = "scop";
1516 repo = "bash-completion";
1617 rev = version;
1717- sha256 = "1813r4jxfa2zgzm2ppjhrq62flfmxai8433pklxcrl4fp5wwx9yv";
1818+ sha256 = "047yjryy9d6hp18wkigbfrw9r0sm31inlsp8l28fhxg8ii032sgq";
1819 };
19202021 nativeBuildInputs = [ autoreconfHook ];
21222223 doCheck = !stdenv.isDarwin;
2324 checkInputs = [
2525+ # perl is assumed by perldoc completion
2626+ perl
2727+ # ps assumed to exist by gdb, killall, pgrep, pidof,
2828+ # pkill, pwdx, renice, and reptyr completions
2929+ ps
2430 python3Packages.pexpect
2531 python3Packages.pytest
2632 bashInteractive
2733 ];
28342929- patches = [
3030- ./0001-Revert-build-Do-cmake-pc-and-profile-variable-replac.patch
3131- # TODO: Remove when https://github.com/scop/bash-completion/commit/2cdac1b9f24df62a1fa80c1824ee8524c9b02393
3232- # is availabe in a release in nixpkgs. see https://github.com/scop/bash-completion/issues/312.
3333- # Fixes a test failure with musl.
3434- (fetchpatch {
3535- url = "https://github.com/scop/bash-completion/commit/2cdac1b9f24df62a1fa80c1824ee8524c9b02393.patch";
3636- name = "bash-completion-musl-test_iconv-skip-option-completion-if-help-fails";
3737- sha256 = "1l53d62zf01k625nzw3vcrxky93h7bzdpchgk4argxalrn17ckvb";
3838- })
3939- ];
4040-4141- # ignore ip_addresses because it tries to touch network
4242- # ignore test_ls because impure logic
3535+ # - ignore test_gcc on ARM because it assumes -march=native
3636+ # - ignore test_chsh because it assumes /etc/shells exists
3737+ # - ignore test_ether_wake, test_ifdown, test_ifstat, test_ifup,
3838+ # test_iperf, test_iperf3, test_nethogs and ip_addresses
3939+ # because they try to touch network
4040+ # - ignore test_ls because impure logic
4141+ # - ignore test_screen because it assumes vt terminals exist
4342 checkPhase = ''
4443 pytest . \
4444+ ${stdenv.lib.optionalString (stdenv.hostPlatform.isAarch64) "--ignore=test/t/test_gcc.py"} \
4545+ --ignore=test/t/test_chsh.py \
4646+ --ignore=test/t/test_ether_wake.py \
4747+ --ignore=test/t/test_ifdown.py \
4848+ --ignore=test/t/test_ifstat.py \
4949+ --ignore=test/t/test_ifup.py \
5050+ --ignore=test/t/test_iperf.py \
5151+ --ignore=test/t/test_iperf3.py \
5252+ --ignore=test/t/test_nethogs.py \
4553 --ignore=test/t/unit/test_unit_ip_addresses.py \
4646- --ignore=test/t/test_ls.py
5454+ --ignore=test/t/test_ls.py \
5555+ --ignore=test/t/test_screen.py
4756 '';
48574958 prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
···5564 description = "Programmable completion for the bash shell";
5665 license = licenses.gpl2Plus;
5766 platforms = platforms.unix;
5858- maintainers = [ maintainers.peti ];
6767+ maintainers = [ maintainers.peti maintainers.xfix ];
5968 };
6069}
+2-1
pkgs/stdenv/generic/setup.sh
···779779# the environment used for building.
780780dumpVars() {
781781 if [ "${noDumpEnvVars:-0}" != 1 ]; then
782782- export > "$NIX_BUILD_TOP/env-vars" || true
782782+ export >| "$NIX_BUILD_TOP/env-vars" || true
783783 fi
784784}
785785···1266126612671267 for curPhase in $phases; do
12681268 if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then continue; fi
12691269+ if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then continue; fi
12691270 if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then continue; fi
12701271 if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then continue; fi
12711272 if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then continue; fi
+9
pkgs/tools/compression/gzip/default.nix
···17171818 makeFlags = [ "SHELL=/bin/sh" "GREP=grep" ];
19192020+ # Many gzip executables are shell scripts that depend upon other gzip
2121+ # executables being in $PATH. Rather than try to re-write all the
2222+ # internal cross-references, just add $out/bin to PATH at the top of
2323+ # all the executables that are shell scripts.
2424+ preFixup = ''
2525+ sed -i '1{;/#!\/bin\/sh/aPATH="'$out'/bin:$PATH"
2626+ }' $out/bin/*
2727+ '';
2828+2029 meta = {
2130 homepage = "https://www.gnu.org/software/gzip/";
2231 description = "GNU zip compression program";
···6666 linux = pkgs.utillinux;
6767 };
6868 getconf = {
6969- linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.glibc
6969+ linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc
7070 else pkgs.netbsd.getconf;
7171 darwin = pkgs.darwin.system_cmds;
7272 };
7373 getent = {
7474- linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.glibc
7474+ linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc
7575 else pkgs.netbsd.getent;
7676 darwin = pkgs.netbsd.getent;
7777 };