···729 <title>Variables controlling the patch phase</title>
730 <varlistentry>
731 <term>
732+ <varname>dontPatch</varname>
733+ </term>
734+ <listitem>
735+ <para>
736+ Set to true to skip the patch phase.
737+ </para>
738+ </listitem>
739+ </varlistentry>
740+ <varlistentry>
741+ <term>
742 <varname>patches</varname>
743 </term>
744 <listitem>
+5
nixos/modules/config/fonts/fontconfig.nix
···4546 # generate the font cache setting file for a fontconfig version
47 # use latest when no version is passed
00048 makeCacheConf = { version ? null }:
49 let
50 fcPackage = if version == null
···60 <fontconfig>
61 <!-- Font directories -->
62 ${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
063 <!-- Pre-generated font caches -->
64 <cachedir>${cache}</cachedir>
65 ${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) ''
66 <cachedir>${cache32}</cachedir>
067 ''}
68 </fontconfig>
69 '';
···4546 # generate the font cache setting file for a fontconfig version
47 # use latest when no version is passed
48+ # When cross-compiling, we can’t generate the cache, so we skip the
49+ # <cachedir> part. fontconfig still works but is a little slower in
50+ # looking things up.
51 makeCacheConf = { version ? null }:
52 let
53 fcPackage = if version == null
···63 <fontconfig>
64 <!-- Font directories -->
65 ${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
66+ ${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
67 <!-- Pre-generated font caches -->
68 <cachedir>${cache}</cachedir>
69 ${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) ''
70 <cachedir>${cache32}</cachedir>
71+ ''}
72 ''}
73 </fontconfig>
74 '';
···7 nssModulesPath = config.system.nssModules.path;
8 cfg = config.services.nscd;
910+ nscd = if pkgs.stdenv.hostPlatform.libc == "glibc"
11+ then pkgs.stdenv.cc.libc.bin
12+ else pkgs.glibc.bin;
13+14in
1516{
···63 # files. So prefix the ExecStart command with "!" to prevent systemd
64 # from dropping privileges early. See ExecStart in systemd.service(5).
65 serviceConfig =
66+ { ExecStart = "!@${nscd}/sbin/nscd nscd";
67 Type = "forking";
68 DynamicUser = true;
69 RuntimeDirectory = "nscd";
70 PIDFile = "/run/nscd/nscd.pid";
71 Restart = "always";
72 ExecReload =
73+ [ "${nscd}/sbin/nscd --invalidate passwd"
74+ "${nscd}/sbin/nscd --invalidate group"
75+ "${nscd}/sbin/nscd --invalidate hosts"
76 ];
77 };
78 };
+2-2
nixos/modules/services/x11/gdk-pixbuf.nix
···19 continue
20 fi
21 GDK_PIXBUF_MODULEDIR="$module_dir" \
22- ${pkgs.gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders
23 done
24 ) > "$out"
25 '';
···37 # If there is any package configured in modulePackages, we generate the
38 # loaders.cache based on that and set the environment variable
39 # GDK_PIXBUF_MODULE_FILE to point to it.
40- config = mkIf (cfg.modulePackages != []) {
41 environment.variables = {
42 GDK_PIXBUF_MODULE_FILE = "${loadersCache}";
43 };
···19 continue
20 fi
21 GDK_PIXBUF_MODULEDIR="$module_dir" \
22+ ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} ${pkgs.gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders
23 done
24 ) > "$out"
25 '';
···37 # If there is any package configured in modulePackages, we generate the
38 # loaders.cache based on that and set the environment variable
39 # GDK_PIXBUF_MODULE_FILE to point to it.
40+ config = mkIf (cfg.modulePackages != [] || pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform) {
41 environment.variables = {
42 GDK_PIXBUF_MODULE_FILE = "${loadersCache}";
43 };
···1+#! @shell@
2+set -eu -o pipefail +o posix
3+shopt -s nullglob
4+5+if (( "${NIX_DEBUG:-0}" >= 7 )); then
6+ set -x
7+fi
8+9+path_backup="$PATH"
10+11+# That @-vars are substituted separately from bash evaluation makes
12+# shellcheck think this, and others like it, are useless conditionals.
13+# shellcheck disable=SC2157
14+if [[ -n "@coreutils_bin@" && -n "@gnugrep_bin@" ]]; then
15+ PATH="@coreutils_bin@/bin:@gnugrep_bin@/bin"
16+fi
17+18+source @out@/nix-support/utils.bash
19+20+# Flirting with a layer violation here.
21+if [ -z "${NIX_BINTOOLS_WRAPPER_@infixSalt@_FLAGS_SET:-}" ]; then
22+ source @bintools@/nix-support/add-flags.sh
23+fi
24+25+# Put this one second so libc ldflags take priority.
26+if [ -z "${NIX_CC_WRAPPER_@infixSalt@_FLAGS_SET:-}" ]; then
27+ source @out@/nix-support/add-flags.sh
28+fi
29+30+31+# Parse command line options and set several variables.
32+# For instance, figure out if linker flags should be passed.
33+# GCC prints annoying warnings when they are not needed.
34+dontLink=0
35+nonFlagArgs=0
36+# shellcheck disable=SC2193
37+38+expandResponseParams "$@"
39+declare -i n=0
40+nParams=${#params[@]}
41+while (( "$n" < "$nParams" )); do
42+ p=${params[n]}
43+ p2=${params[n+1]:-} # handle `p` being last one
44+ if [ "$p" = -c ]; then
45+ dontLink=1
46+ elif [ "$p" = -S ]; then
47+ dontLink=1
48+ elif [ "$p" = -E ]; then
49+ dontLink=1
50+ elif [ "$p" = -E ]; then
51+ dontLink=1
52+ elif [ "$p" = -M ]; then
53+ dontLink=1
54+ elif [ "$p" = -MM ]; then
55+ dontLink=1
56+ elif [[ "$p" = -x && "$p2" = *-header ]]; then
57+ dontLink=1
58+ elif [[ "$p" != -?* ]]; then
59+ # A dash alone signifies standard input; it is not a flag
60+ nonFlagArgs=1
61+ fi
62+ n+=1
63+done
64+65+# If we pass a flag like -Wl, then gcc will call the linker unless it
66+# can figure out that it has to do something else (e.g., because of a
67+# "-c" flag). So if no non-flag arguments are given, don't pass any
68+# linker flags. This catches cases like "gcc" (should just print
69+# "gcc: no input files") and "gcc -v" (should print the version).
70+if [ "$nonFlagArgs" = 0 ]; then
71+ dontLink=1
72+fi
73+74+# Optionally filter out paths not refering to the store.
75+if [[ "${NIX_ENFORCE_PURITY:-}" = 1 && -n "$NIX_STORE" ]]; then
76+ rest=()
77+ nParams=${#params[@]}
78+ declare -i n=0
79+ while (( "$n" < "$nParams" )); do
80+ p=${params[n]}
81+ p2=${params[n+1]:-} # handle `p` being last one
82+ if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then
83+ skip "${p:2}"
84+ elif [ "$p" = -L ] && badPath "$p2"; then
85+ n+=1; skip "$p2"
86+ elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then
87+ skip "${p:2}"
88+ elif [ "$p" = -I ] && badPath "$p2"; then
89+ n+=1; skip "$p2"
90+ elif [ "${p:0:4}" = -aI/ ] && badPath "${p:3}"; then
91+ skip "${p:3}"
92+ elif [ "$p" = -aI ] && badPath "$p2"; then
93+ n+=1; skip "$p2"
94+ elif [ "${p:0:4}" = -aO/ ] && badPath "${p:3}"; then
95+ skip "${p:3}"
96+ elif [ "$p" = -aO ] && badPath "$p2"; then
97+ n+=1; skip "$p2"
98+ elif [ "$p" = -isystem ] && badPath "$p2"; then
99+ n+=1; skip "$p2"
100+ else
101+ rest+=("$p")
102+ fi
103+ n+=1
104+ done
105+ # Old bash empty array hack
106+ params=(${rest+"${rest[@]}"})
107+fi
108+109+110+# Clear march/mtune=native -- they bring impurity.
111+if [ "$NIX_@infixSalt@_ENFORCE_NO_NATIVE" = 1 ]; then
112+ rest=()
113+ # Old bash empty array hack
114+ for p in ${params+"${params[@]}"}; do
115+ if [[ "$p" = -m*=native ]]; then
116+ skip "$p"
117+ else
118+ rest+=("$p")
119+ fi
120+ done
121+ # Old bash empty array hack
122+ params=(${rest+"${rest[@]}"})
123+fi
124+125+if [ "$(basename $0)x" = "gnatmakex" ]; then
126+ extraBefore=("--GNATBIND=@out@/bin/gnatbind" "--GNATLINK=@out@/bin/gnatlink")
127+ extraAfter=($NIX_@infixSalt@_GNATFLAGS_COMPILE)
128+fi
129+130+if [ "$(basename $0)x" = "gnatbindx" ]; then
131+ extraBefore=()
132+ extraAfter=($NIX_@infixSalt@_GNATFLAGS_COMPILE)
133+fi
134+135+if [ "$(basename $0)x" = "gnatlinkx" ]; then
136+ extraBefore=()
137+ extraAfter=("--GCC=@out@/bin/gcc")
138+fi
139+140+# As a very special hack, if the arguments are just `-v', then don't
141+# add anything. This is to prevent `gcc -v' (which normally prints
142+# out the version number and returns exit code 0) from printing out
143+# `No input files specified' and returning exit code 1.
144+if [ "$*" = -v ]; then
145+ extraAfter=()
146+ extraBefore=()
147+fi
148+149+# Optionally print debug info.
150+if (( "${NIX_DEBUG:-0}" >= 1 )); then
151+ # Old bash workaround, see ld-wrapper for explanation.
152+ echo "extra flags before to @prog@:" >&2
153+ printf " %q\n" ${extraBefore+"${extraBefore[@]}"} >&2
154+ echo "original flags to @prog@:" >&2
155+ printf " %q\n" ${params+"${params[@]}"} >&2
156+ echo "extra flags after to @prog@:" >&2
157+ printf " %q\n" ${extraAfter+"${extraAfter[@]}"} >&2
158+fi
159+160+PATH="$path_backup"
161+# Old bash workaround, see above.
162+exec @prog@ \
163+ ${extraBefore+"${extraBefore[@]}"} \
164+ ${params+"${params[@]}"} \
165+ ${extraAfter+"${extraAfter[@]}"}
+2-2
pkgs/build-support/setup-hooks/auto-patchelf.sh
···15 # *or* there is an INTERP section. This also catches position-independent
16 # executables, as they typically have an INTERP section but their ELF type
17 # is DYN.
18- isExeResult="$(LANG=C readelf -h -l "$1" 2> /dev/null \
19 | grep '^ *Type: *EXEC\>\|^ *INTERP\>')"
20 # not using grep -q, because it can cause Broken pipe
21 [ -n "$isExeResult" ]
···207 # outside of this function.
208 while IFS= read -r -d $'\0' file; do
209 isELF "$file" || continue
210- segmentHeaders="$(LANG=C readelf -l "$file")"
211 # Skip if the ELF file doesn't have segment headers (eg. object files).
212 # not using grep -q, because it can cause Broken pipe
213 [ -n "$(echo "$segmentHeaders" | grep '^Program Headers:')" ] || continue
···15 # *or* there is an INTERP section. This also catches position-independent
16 # executables, as they typically have an INTERP section but their ELF type
17 # is DYN.
18+ isExeResult="$(LANG=C $READELF -h -l "$1" 2> /dev/null \
19 | grep '^ *Type: *EXEC\>\|^ *INTERP\>')"
20 # not using grep -q, because it can cause Broken pipe
21 [ -n "$isExeResult" ]
···207 # outside of this function.
208 while IFS= read -r -d $'\0' file; do
209 isELF "$file" || continue
210+ segmentHeaders="$(LANG=C $READELF -l "$file")"
211 # Skip if the ELF file doesn't have segment headers (eg. object files).
212 # not using grep -q, because it can cause Broken pipe
213 [ -n "$(echo "$segmentHeaders" | grep '^Program Headers:')" ] || continue
+1-1
pkgs/data/icons/hicolor-icon-theme/setup-hook.sh
···10}
1112# I think this is meant to be a runtime dep
13-addEnvHooks "${hostOffset:?}" hicolorIconThemeHook
···10}
1112# I think this is meant to be a runtime dep
13+addEnvHooks "${targetOffset:?}" hicolorIconThemeHook
···6566 # Install bash-completions to correct prefix.
67 # https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1194
68- ./fix-bash-completion.patch
0006970 # Use absolute path for libshew installation to make our patched gobject-introspection
71 # aware of the location to hardcode in the generated GIR file.
···6566 # Install bash-completions to correct prefix.
67 # https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1194
68+ (fetchpatch {
69+ url = "https://gitlab.gnome.org/GNOME/gnome-shell/commit/9f1ad5d86ddbabaa840eb2860279d53f4e635453.patch";
70+ sha256 = "f8MDFbfg9D7ORF84Ld9GIvf0xRCYuSszo3QLMji2VaE=";
71+ })
7273 # Use absolute path for libshew installation to make our patched gobject-introspection
74 # aware of the location to hardcode in the generated GIR file.
···1+diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
2+index 4e74252bd74..0d848b5b4e3 100644
3+--- a/gcc/ada/gcc-interface/Makefile.in
4++++ b/gcc/ada/gcc-interface/Makefile.in
5+@@ -111,7 +111,7 @@ NO_OMIT_ADAFLAGS = -fno-omit-frame-pointer
6+ NO_SIBLING_ADAFLAGS = -fno-optimize-sibling-calls
7+ NO_REORDER_ADAFLAGS = -fno-toplevel-reorder
8+ GNATLIBFLAGS = -W -Wall -gnatpg -nostdinc
9+-GNATLIBCFLAGS = -g -O2
10++GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET)
11+ # Pretend that _Unwind_GetIPInfo is available for the target by default. This
12+ # should be autodetected during the configuration of libada and passed down to
13+ # here, but we need something for --disable-libada and hope for the best.
14+@@ -198,7 +198,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
15+ # Link flags used to build gnat tools. By default we prefer to statically
16+ # link with libgcc to avoid a dependency on shared libgcc (which is tricky
17+ # to deal with as it may conflict with the libgcc provided by the system).
18+-GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc
19++GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc $(CFLAGS_FOR_TARGET)
20+21+ # End of variables for you to override.
22+23+diff --git a/libada/Makefile.in b/libada/Makefile.in
24+index 522b9207326..ca866c74471 100644
25+--- a/libada/Makefile.in
26++++ b/libada/Makefile.in
27+@@ -59,7 +59,7 @@ LDFLAGS=
28+ CFLAGS=-g
29+ PICFLAG = @PICFLAG@
30+ GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
31+-GNATLIBCFLAGS= -g -O2
32++GNATLIBCFLAGS= -g -O2 $(CFLAGS)
33+ GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
34+ -fexceptions -DIN_RTS @have_getipinfo@ @have_capability@
35+
···1-2make_glib_find_gsettings_schemas() {
3 # For packages that need gschemas of other packages (e.g. empathy)
4 for maybe_dir in "$1"/share/gsettings-schemas/*; do
···7 fi
8 done
9}
10-addEnvHooks "$hostOffset" make_glib_find_gsettings_schemas
1112# Install gschemas, if any, in a package-specific directory
13glibPreInstallPhase() {
···01make_glib_find_gsettings_schemas() {
2 # For packages that need gschemas of other packages (e.g. empathy)
3 for maybe_dir in "$1"/share/gsettings-schemas/*; do
···6 fi
7 done
8}
9+addEnvHooks "$targetOffset" make_glib_find_gsettings_schemas
1011# Install gschemas, if any, in a package-specific directory
12glibPreInstallPhase() {
···7374 # https://gitlab.gnome.org/GNOME/gtk/merge_requests/1002
75 ./patches/01-build-Fix-path-handling-in-pkgconfig.patch
00000000000000076 ] ++ optionals stdenv.isDarwin [
77 # X11 module requires <gio/gdesktopappinfo.h> which is not installed on Darwin
78 # let’s drop that dependency in similar way to how other parts of the library do it
···7374 # https://gitlab.gnome.org/GNOME/gtk/merge_requests/1002
75 ./patches/01-build-Fix-path-handling-in-pkgconfig.patch
76+77+ # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1634
78+ (fetchpatch {
79+ url = "https://gitlab.gnome.org/GNOME/gtk/-/commit/79732da1ed8cb167440fb047c72cfc0d888a187b.patch";
80+ sha256 = "1ynrx81dkwjfqhvg80q28qbb6jabg4x73fkbrnligzgkzimfjpx3";
81+ })
82+ # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1633
83+ (fetchpatch {
84+ url = "https://gitlab.gnome.org/GNOME/gtk/-/commit/12fc9a45efcbb546eb7de13c5c4d3183f2f5a3b8.patch";
85+ sha256 = "00zrm77qk39p1hgn207az82cgvqiyp6is7dk0ssjxkc34403r78v";
86+ })
87+ (fetchpatch {
88+ url = "https://gitlab.gnome.org/GNOME/gtk/-/commit/5a52af20cba76474e631b2a7548963bcad22d66d.patch";
89+ sha256 = "0sbzzwa0si1w83m5abyf312f4w445wwlms53m5hb7kdgkjbhaa3f";
90+ })
91 ] ++ optionals stdenv.isDarwin [
92 # X11 module requires <gio/gdesktopappinfo.h> which is not installed on Darwin
93 # let’s drop that dependency in similar way to how other parts of the library do it
+5
pkgs/development/libraries/libasyncns/default.nix
···8 sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg";
9 };
100000011 meta = with stdenv.lib; {
12 homepage = "http://0pointer.de/lennart/projects/libasyncns/";
13 description = "A C library for Linux/Unix for executing name service queries asynchronously";
···8 sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg";
9 };
1011+ configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
12+ "ac_cv_func_malloc_0_nonnull=yes"
13+ "ac_cv_func_realloc_0_nonnull=yes"
14+ ];
15+16 meta = with stdenv.lib; {
17 homepage = "http://0pointer.de/lennart/projects/libasyncns/";
18 description = "A C library for Linux/Unix for executing name service queries asynchronously";
+5
pkgs/development/libraries/libcddb/default.nix
···1011 buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv;
120000013 doCheck = false; # fails 3 of 5 tests with locale errors
1415 meta = with stdenv.lib; {
···1011 buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv;
1213+ configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
14+ "ac_cv_func_malloc_0_nonnull=yes"
15+ "ac_cv_func_realloc_0_nonnull=yes"
16+ ];
17+18 doCheck = false; # fails 3 of 5 tests with locale errors
1920 meta = with stdenv.lib; {
···135 experimentalFpMbStatsSupport ||
136 experimentalEmulateHardwareSupport) "experimental")
137 ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
138- #"--extra-cflags="
139- #"--extra-cxxflags="
140- #"--prefix="
141- #"--libc="
142- #"--libdir="
143- "--enable-external-build"
144 # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version)
145 # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure
146 # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14
147- "--force-target=${stdenv.hostPlatform.config}${
148 if stdenv.hostPlatform.isDarwin then
149 if stdenv.hostPlatform.osxMinVersion == "10.10" then "14"
150 else if stdenv.hostPlatform.osxMinVersion == "10.9" then "13"
···135 experimentalFpMbStatsSupport ||
136 experimentalEmulateHardwareSupport) "experimental")
137 ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
000000138 # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version)
139 # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure
140 # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14
141+ "--force-target=${stdenv.hostPlatform.parsed.cpu.name}-${stdenv.hostPlatform.parsed.kernel.name}${
142 if stdenv.hostPlatform.isDarwin then
143 if stdenv.hostPlatform.osxMinVersion == "10.10" then "14"
144 else if stdenv.hostPlatform.osxMinVersion == "10.9" then "13"
···1+From e996904128653c67b04ddbdb1e10cef158098957 Mon Sep 17 00:00:00 2001
2+From: Samuel Dionne-Riel <samuel@dionne-riel.com>
3+Date: Fri, 6 Dec 2019 23:00:51 -0500
4+Subject: [PATCH] [HACK]: Assumes Expat paths are good.
5+6+The `check_lib` check fails with the cross-compilation build platform's
7+Perl, since apparently `mktemp` is missing...
8+9+Even then, side-stepping the issue, it seems it is not actually enough
10+to work, as the compilation fails.
11+---
12+ Makefile.PL | 17 +++++++++++------
13+ 1 file changed, 11 insertions(+), 6 deletions(-)
14+15+diff --git a/Makefile.PL b/Makefile.PL
16+index 505d1df..fc38b76 100644
17+--- a/Makefile.PL
18++++ b/Makefile.PL
19+@@ -29,12 +29,17 @@ foreach (@ARGV) {
20+ @ARGV = @replacement_args;
21+22+ unless (
23+- check_lib( # fill in what you prompted the user for here
24+- lib => [qw(expat)],
25+- header => ['expat.h'],
26+- incpath => $expat_incpath,
27+- ( $expat_libpath ? ( libpath => $expat_libpath ) : () ),
28+- )
29++ #check_lib( # fill in what you prompted the user for here
30++ # lib => [qw(expat)],
31++ # header => ['expat.h'],
32++ # incpath => $expat_incpath,
33++ # ( $expat_libpath ? ( libpath => $expat_libpath ) : () ),
34++ #)
35++ # The check_lib implementation fails horribly with cross-compilation.
36++ # We are giving known good paths to expat.
37++ # And in all cases, the previous behaviour of not actually failing
38++ # seemed to work just fine :/.
39++ false
40+ ) {
41+ warn <<'Expat_Not_Installed;';
42+43+--
44+2.23.0
45+
···1--- a/mesonbuild/coredata.py
2+++ b/mesonbuild/coredata.py
3-@@ -375,18 +375,13 @@
4- '''
5- if option.endswith('dir') and os.path.isabs(value) and \
6 option not in builtin_dir_noprefix_options:
7- # Value must be a subdir of the prefix
8 # commonpath will always return a path in the native format, so we
9 # must use pathlib.PurePath to do the same conversion before
10 # comparing.
11-- if os.path.commonpath([value, prefix]) != str(PurePath(prefix)):
12-- m = 'The value of the {!r} option is {!r} which must be a ' \
13-- 'subdir of the prefix {!r}.\nNote that if you pass a ' \
14-- 'relative path, it is assumed to be a subdir of prefix.'
15-- raise MesonException(m.format(option, value, prefix))
16-- # Convert path to be relative to prefix
17-- skip = len(prefix) + 1
18-- value = value[skip:]
19-+ if os.path.commonpath([value, prefix]) == str(PurePath(prefix)):
20-+ # Convert path to be relative to prefix
21-+ skip = len(prefix) + 1
22-+ value = value[skip:]
23- return value
24-25- def init_builtins(self):
···1--- a/mesonbuild/coredata.py
2+++ b/mesonbuild/coredata.py
3+@@ -483,7 +483,6 @@ class CoreData:
4+ return value
5+ if option.endswith('dir') and value.is_absolute() and \
6 option not in builtin_dir_noprefix_options:
7- # Value must be a subdir of the prefix
8 # commonpath will always return a path in the native format, so we
9 # must use pathlib.PurePath to do the same conversion before
10 # comparing.
11+@@ -495,7 +494,7 @@ class CoreData:
12+ try:
13+ value = value.relative_to(prefix)
14+ except ValueError:
15+- raise MesonException(msg.format(option, value, prefix))
16++ pass
17+ if '..' in str(value):
18+ raise MesonException(msg.format(option, value, prefix))
19+ return value.as_posix()
000000
···1+From a6c9317a905ef478b8e0d3dad263990feb5d11cb Mon Sep 17 00:00:00 2001
2+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
3+Date: Tue, 8 Jan 2013 15:46:30 +0100
4+Subject: [PATCH 01/27] Start device units for uninitialised encrypted devices
5+6+This is necessary because the NixOS service that initialises the
7+filesystem depends on the appearance of the device unit. Also, this
8+makes more sense to me: the device is ready; it's the filesystem
9+that's not, but taking care of that is the responsibility of the mount
10+unit. (However, this ignores the fsck unit, so it's not perfect...)
11+---
12+ rules.d/99-systemd.rules.in | 4 ----
13+ 1 file changed, 4 deletions(-)
14+15+diff --git a/rules.d/99-systemd.rules.in b/rules.d/99-systemd.rules.in
16+index c34b606216..3ab8c1c3fe 100644
17+--- a/rules.d/99-systemd.rules.in
18++++ b/rules.d/99-systemd.rules.in
19+@@ -17,10 +17,6 @@ SUBSYSTEM=="ubi", TAG+="systemd"
20+ SUBSYSTEM=="block", TAG+="systemd"
21+ SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
22+23+-# Ignore encrypted devices with no identified superblock on it, since
24+-# we are probably still calling mke2fs or mkswap on it.
25+-SUBSYSTEM=="block", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
26+-
27+ # add symlink to GPT root disk
28+ SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}!="crypto_LUKS", SYMLINK+="gpt-auto-root"
29+ SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}=="crypto_LUKS", SYMLINK+="gpt-auto-root-luks"
30+--
31+2.24.1
32+
···1+From 3eb1716dd80c245a2883da04156af79fb9097519 Mon Sep 17 00:00:00 2001
2+From: Andreas Rammhold <andreas@rammhold.de>
3+Date: Fri, 2 Nov 2018 21:15:42 +0100
4+Subject: [PATCH 19/27] inherit systemd environment when calling generators.
5+6+Systemd generators need access to the environment configured in
7+stage-2-init.sh since it schedules fsck and mkfs executions based on
8+being able to find an appropriate binary for the target filesystem.
9+10+With this commit I am altering the systemd behaviour since upstream
11+tries to gather environments with that they call
12+"environment-generators" and then seems to pass that on to all the other
13+executables that are being called from managers.
14+---
15+ src/core/manager.c | 11 ++++++++---
16+ 1 file changed, 8 insertions(+), 3 deletions(-)
17+18+diff --git a/src/core/manager.c b/src/core/manager.c
19+index d9114bb0c5..22c3b6ff76 100644
20+--- a/src/core/manager.c
21++++ b/src/core/manager.c
22+@@ -3868,9 +3868,14 @@ static int manager_run_generators(Manager *m) {
23+ argv[4] = NULL;
24+25+ RUN_WITH_UMASK(0022)
26+- (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC, NULL, NULL,
27+- (char**) argv, m->transient_environment, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
28+-
29++ (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC,
30++ // On NixOS we must propagate PATH to generators so they are
31++ // able to find binaries such as `fsck.${fstype}` and
32++ // `mkfs.${fstype}`. That is why the last argument of the
33++ // function (envp) is set to NULL. This propagates systemd's
34++ // environment (e.g. PATH) that was setup
35++ // before calling systemd from stage-2-init.sh.
36++ NULL, NULL, (char**) argv, /* NixOS: use inherited env */ NULL, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
37+ r = 0;
38+39+ finish:
40+--
41+2.24.1
42+
···1+From 8d1618a97ad08078815f409f03b45aff3ae6bd0a Mon Sep 17 00:00:00 2001
2+From: Andreas Rammhold <andreas@rammhold.de>
3+Date: Thu, 9 May 2019 11:15:22 +0200
4+Subject: [PATCH 21/27] add rootprefix to lookup dir paths
5+6+systemd does not longer use the UDEVLIBEXEC directory as root for
7+discovery default udev rules. By adding `$out/lib` to the lookup paths
8+we should again be able to discover the udev rules amongst other default
9+files that I might have missed.
10+---
11+ src/basic/def.h | 6 ++++--
12+ 1 file changed, 4 insertions(+), 2 deletions(-)
13+14+diff --git a/src/basic/def.h b/src/basic/def.h
15+index 2af0b763f0..17959b07e8 100644
16+--- a/src/basic/def.h
17++++ b/src/basic/def.h
18+@@ -39,13 +39,15 @@
19+ "/run/" n "\0" \
20+ "/usr/local/lib/" n "\0" \
21+ "/usr/lib/" n "\0" \
22+- _CONF_PATHS_SPLIT_USR_NULSTR(n)
23++ _CONF_PATHS_SPLIT_USR_NULSTR(n) \
24++ ROOTPREFIX "/lib/" n "\0"
25+26+ #define CONF_PATHS_USR(n) \
27+ "/etc/" n, \
28+ "/run/" n, \
29+ "/usr/local/lib/" n, \
30+- "/usr/lib/" n
31++ "/usr/lib/" n, \
32++ ROOTPREFIX "/lib/" n
33+34+ #define CONF_PATHS(n) \
35+ CONF_PATHS_USR(n) \
36+--
37+2.24.1
38+
···779# the environment used for building.
780dumpVars() {
781 if [ "${noDumpEnvVars:-0}" != 1 ]; then
782- export > "$NIX_BUILD_TOP/env-vars" || true
783 fi
784}
785···12661267 for curPhase in $phases; do
1268 if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then continue; fi
01269 if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then continue; fi
1270 if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then continue; fi
1271 if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then continue; fi
···779# the environment used for building.
780dumpVars() {
781 if [ "${noDumpEnvVars:-0}" != 1 ]; then
782+ export >| "$NIX_BUILD_TOP/env-vars" || true
783 fi
784}
785···12661267 for curPhase in $phases; do
1268 if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then continue; fi
1269+ if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then continue; fi
1270 if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then continue; fi
1271 if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then continue; fi
1272 if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then continue; fi
···1718 makeFlags = [ "SHELL=/bin/sh" "GREP=grep" ];
1920+ # Many gzip executables are shell scripts that depend upon other gzip
21+ # executables being in $PATH. Rather than try to re-write all the
22+ # internal cross-references, just add $out/bin to PATH at the top of
23+ # all the executables that are shell scripts.
24+ preFixup = ''
25+ sed -i '1{;/#!\/bin\/sh/aPATH="'$out'/bin:$PATH"
26+ }' $out/bin/*
27+ '';
28+29 meta = {
30 homepage = "https://www.gnu.org/software/gzip/";
31 description = "GNU zip compression program";