···734with the exception of `other` (see `format` in
735[`buildPythonPackage` parameters](#buildpythonpackage-parameters) for more details).
7360000000000737### Develop local package {#develop-local-package}
738739As a Python developer you're likely aware of [development mode](http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode)
···1270 with the `pipInstallHook`.
1271- `pythonRelaxDepsHook` will relax Python dependencies restrictions for the package.
1272 See [example usage](#using-pythonrelaxdepshook).
012731274### Development mode {#development-mode}
1275
···734with the exception of `other` (see `format` in
735[`buildPythonPackage` parameters](#buildpythonpackage-parameters) for more details).
736737+### Using unittestCheckHook {#using-unittestcheckhook}
738+739+`unittestCheckHook` is a hook which will substitute the setuptools `test` command for a `checkPhase` which runs `python -m unittest discover`:
740+741+```
742+ checkInputs = [ unittestCheckHook ];
743+744+ unittestFlags = [ "-s" "tests" "-v" ];
745+```
746+747### Develop local package {#develop-local-package}
748749As a Python developer you're likely aware of [development mode](http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode)
···1280 with the `pipInstallHook`.
1281- `pythonRelaxDepsHook` will relax Python dependencies restrictions for the package.
1282 See [example usage](#using-pythonrelaxdepshook).
1283+- `unittestCheckHook` will run tests with `python -m unittest discover`. See [example usage](#using-unittestcheckhook).
12841285### Development mode {#development-mode}
1286
+7-1
lib/systems/default.nix
···65 # is why we use the more obscure "bfd" and not "binutils" for this
66 # choice.
67 else "bfd";
68- extensions = {
69 sharedLibrary =
70 /**/ if final.isDarwin then ".dylib"
71 else if final.isWindows then ".dll"
72 else ".so";
00000073 executable =
74 /**/ if final.isWindows then ".exe"
75 else "";
···65 # is why we use the more obscure "bfd" and not "binutils" for this
66 # choice.
67 else "bfd";
68+ extensions = rec {
69 sharedLibrary =
70 /**/ if final.isDarwin then ".dylib"
71 else if final.isWindows then ".dll"
72 else ".so";
73+ staticLibrary =
74+ /**/ if final.isWindows then ".lib"
75+ else ".a";
76+ library =
77+ /**/ if final.isStatic then staticLibrary
78+ else sharedLibrary;
79 executable =
80 /**/ if final.isWindows then ".exe"
81 else "";
···2export NIX_LDFLAGS+=" --compress-debug-sections=zlib"
3export NIX_CFLAGS_COMPILE+=" -ggdb -Wa,--compress-debug-sections"
4export RUSTFLAGS+=" -g"
056fixupOutputHooks+=(_separateDebugInfo)
7···34 # firmware blobs in QEMU.)
35 (
36 $OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
03738 # Also a create a symlink <original-name>.debug.
39 ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
+12-11
pkgs/build-support/setup-hooks/strip.sh
···38stripDirs() {
39 local cmd="$1"
40 local ranlibCmd="$2"
41- local dirs="$3"
42 local stripFlags="$4"
43- local dirsNew=
4445- local d
46- for d in ${dirs}; do
47- if [ -d "$prefix/$d" ]; then
48- dirsNew="${dirsNew} $prefix/$d "
49 fi
50 done
51- dirs=${dirsNew}
5253- if [ -n "${dirs}" ]; then
54- echo "stripping (with command $cmd and flags $stripFlags) in$dirs"
55- find $dirs -type f -exec $cmd $stripFlags '{}' \; 2>/dev/null
056 # 'strip' does not normally preserve archive index in .a files.
57 # This usually causes linking failures against static libs like:
58 # ld: ...-i686-w64-mingw32-stage-final-gcc-13.0.0-lib/i686-w64-mingw32/lib/libstdc++.dll.a:
59 # error adding symbols: archive has no index; run ranlib to add one
60 # Restore the index by running 'ranlib'.
61- find $dirs -name '*.a' -type f -exec $ranlibCmd '{}' \; 2>/dev/null
62 fi
63}
···38stripDirs() {
39 local cmd="$1"
40 local ranlibCmd="$2"
41+ local paths="$3"
42 local stripFlags="$4"
43+ local pathsNew=
4445+ local p
46+ for p in ${paths}; do
47+ if [ -e "$prefix/$p" ]; then
48+ pathsNew="${pathsNew} $prefix/$p"
49 fi
50 done
51+ paths=${pathsNew}
5253+ if [ -n "${paths}" ]; then
54+ echo "stripping (with command $cmd and flags $stripFlags) in $paths"
55+ # Do not strip lib/debug. This is a directory used by setup-hooks/separate-debug-info.sh.
56+ find $paths -type f -a '!' -wholename "$prefix/lib/debug/*" -exec $cmd $stripFlags '{}' \; 2>/dev/null
57 # 'strip' does not normally preserve archive index in .a files.
58 # This usually causes linking failures against static libs like:
59 # ld: ...-i686-w64-mingw32-stage-final-gcc-13.0.0-lib/i686-w64-mingw32/lib/libstdc++.dll.a:
60 # error adding symbols: archive has no index; run ranlib to add one
61 # Restore the index by running 'ranlib'.
62+ find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2>/dev/null
63 fi
64}
···1+diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
2+index 4ea029dbde..af94a4d90b 100644
3+--- a/src/time/zoneinfo_unix.go
4++++ b/src/time/zoneinfo_unix.go
5+@@ -20,6 +20,7 @@ import (
6+ // Many systems use /usr/share/zoneinfo, Solaris 2 has
7+ // /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ.
8+ var zoneSources = []string{
9++ "@tzdata@/share/zoneinfo/",
10+ "/usr/share/zoneinfo/",
11+ "/usr/share/lib/zoneinfo/",
12+ "/usr/lib/locale/TZ/",
+12
pkgs/development/compilers/go/tzdata-1.19.patch
···000000000000
···1+diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
2+index 67b8beb47b..5cd1fb1759 100644
3+--- a/src/time/zoneinfo_unix.go
4++++ b/src/time/zoneinfo_unix.go
5+@@ -18,6 +18,7 @@ import (
6+ // Many systems use /usr/share/zoneinfo, Solaris 2 has
7+ // /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ.
8+ var platformZoneSources = []string{
9++ "@tzdata@/share/zoneinfo/",
10+ "/usr/share/zoneinfo/",
11+ "/usr/share/lib/zoneinfo/",
12+ "/usr/lib/locale/TZ/",
-64
pkgs/development/compilers/rust/1_62.nix
···1-# New rust versions should first go to staging.
2-# Things to check after updating:
3-# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
4-# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
5-# This testing can be also done by other volunteers as part of the pull
6-# request review, in case platforms cannot be covered.
7-# 2. The LLVM version used for building should match with rust upstream.
8-# Check the version number in the src/llvm-project git submodule in:
9-# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
10-# 3. Firefox and Thunderbird should still build on x86_64-linux.
11-12-{ stdenv, lib
13-, buildPackages
14-, newScope, callPackage
15-, CoreFoundation, Security, SystemConfiguration
16-, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
17-, makeRustPlatform
18-, llvmPackages_11
19-, llvmPackages_14, llvm_14
20-} @ args:
21-22-import ./default.nix {
23- rustcVersion = "1.62.1";
24- rustcSha256 = "sha256-cqy+b/zZT1mDgqdDCw2F7o9nnm0LJ/P1Zu0cFsl4Ez8=";
25-26- llvmSharedForBuild = pkgsBuildBuild.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
27- llvmSharedForHost = pkgsBuildHost.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
28- llvmSharedForTarget = pkgsBuildTarget.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
29-30- llvmBootstrapForDarwin = llvmPackages_11;
31-32- # For use at runtime
33- llvmShared = llvm_14.override { enableSharedLibraries = true; };
34-35- # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox
36- llvmPackages = llvmPackages_14;
37-38- # Note: the version MUST be one version prior to the version we're
39- # building
40- bootstrapVersion = "1.61.0";
41-42- # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
43- bootstrapHashes = {
44- i686-unknown-linux-gnu = "b15eb0ad44b7253e0b5b1a8cd285feb10e9fb0402840dba9a13112c3349a4b39";
45- x86_64-unknown-linux-gnu = "066b324239d30787ce64142d7e04912f2e1850c07db3b2354d8654e02ff8b23a";
46- x86_64-unknown-linux-musl = "0904f6b769ae28c259e0e25a41e99290a4ae2a36bca63ae153790b2ebbc427bf";
47- arm-unknown-linux-gnueabihf = "cc32705cd1b583aaac74e6663f71392131dc0355a0f484cb56f0378b71ea7ebc";
48- armv7-unknown-linux-gnueabihf = "2782ec75ea4abb402513e2e57becc6c14e67b492d57228cddedef6db0853b165";
49- aarch64-unknown-linux-gnu = "261cd47bc3c98c9f97b601d1ad2a7d9b33c9ea63c9a351119c2f6d4e82f5d436";
50- aarch64-unknown-linux-musl = "feb79985cb161a10b252236852df8db3bf3593c78905b84c7e94cd4454327e47";
51- x86_64-apple-darwin = "d851f1a473926a5d8f111ed08002047a5dc4ad944a5b7f8d5d2f1f266b51e66a";
52- aarch64-apple-darwin = "2dbafd13d007543aada47179fa273f9a3865f27e0a07bd69be61801232a0819e";
53- powerpc64le-unknown-linux-gnu = "6d5cd579b68a2adc20384406c69a92beaaf4941056e126ff0ed1ec2f3a4e721f";
54- riscv64gc-unknown-linux-gnu = "3d0f3b1a8522e09fffdf920a061794ac3107410eb1fe8f5d62a7aae3c6dcb81e";
55- mips64el-unknown-linux-gnuabi64 = "6ed5b6492e68f45488108abd06dbcd4b89c46cdbd4715331bb11e88f18500815";
56- };
57-58- selectRustPackage = pkgs: pkgs.rust_1_62;
59-60- rustcPatches = [
61- ];
62-}
63-64-(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_11" "llvmPackages_14" "llvm_14"])
···1+# New rust versions should first go to staging.
2+# Things to check after updating:
3+# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
4+# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
5+# This testing can be also done by other volunteers as part of the pull
6+# request review, in case platforms cannot be covered.
7+# 2. The LLVM version used for building should match with rust upstream.
8+# Check the version number in the src/llvm-project git submodule in:
9+# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
10+# 3. Firefox and Thunderbird should still build on x86_64-linux.
11+12+{ stdenv, lib
13+, buildPackages
14+, newScope, callPackage
15+, CoreFoundation, Security, SystemConfiguration
16+, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
17+, makeRustPlatform
18+, llvmPackages_11
19+, llvmPackages_14, llvm_14
20+} @ args:
21+22+import ./default.nix {
23+ rustcVersion = "1.63.0";
24+ rustcSha256 = "1l4rrbzhxv88pnfq94nbyb9m6lfnjwixma3mwjkmvvs2aqlq158z";
25+26+ llvmSharedForBuild = pkgsBuildBuild.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
27+ llvmSharedForHost = pkgsBuildHost.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
28+ llvmSharedForTarget = pkgsBuildTarget.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
29+30+ llvmBootstrapForDarwin = llvmPackages_11;
31+32+ # For use at runtime
33+ llvmShared = llvm_14.override { enableSharedLibraries = true; };
34+35+ # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox
36+ llvmPackages = llvmPackages_14;
37+38+ # Note: the version MUST be one version prior to the version we're
39+ # building
40+ bootstrapVersion = "1.62.1";
41+42+ # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
43+ bootstrapHashes = {
44+ i686-unknown-linux-gnu = "1669163ffe01e252ffb62da7d84949378fc274931a65ac827d54059a5ffc542c";
45+ x86_64-unknown-linux-gnu = "dd7d82b8fa8eae59729e1c31fe59a9de6ee61d08ab40ce016185653beebe04d2";
46+ x86_64-unknown-linux-musl = "32bee487074b105e2582cddce35934a6019eec74bae3f9300fdc3edfcf5b66d4";
47+ arm-unknown-linux-gnueabihf = "5c735e8174d394936d7b499c2d147ddadf3c4d77e652d1e0b0a72d9d09f81ea4";
48+ armv7-unknown-linux-gnueabihf = "26fa731385f1a71211ba8e3c94f3bb3b1a82bde89f8d4dcf75b4b463b57b0f88";
49+ aarch64-unknown-linux-gnu = "1311fa8204f895d054c23a3481de3b158a5cd3b3a6338761fee9cdf4dbf075a5";
50+ aarch64-unknown-linux-musl = "73bbab4d8a9e3c416035d40406e656ab37e785df35fa069a33af52e931a24b12";
51+ x86_64-apple-darwin = "0a04dcf2b521239826f3eaa66d77169d91e68087ccc3107b54e8aba7c02c9adf";
52+ aarch64-apple-darwin = "6d1671ea31b05cab5e2587cc2b295b3e7232b0135f0977355618e2a01933ff0a";
53+ powerpc64le-unknown-linux-gnu = "1d3248e1a673cda87cf443cd4334ff5fb53e6f87c72d3587b07e5c0cb507f3ae";
54+ riscv64gc-unknown-linux-gnu = "fd378d0bf866689e8111aba0e2b020da87f32f70fb11d98a575d42dc05978c2a";
55+ mips64el-unknown-linux-gnuabi64 = "b7c47dd94728161aa96762fb7bc51b6ab0feba7c5215d06eaea5b78649815a96";
56+ };
57+58+ selectRustPackage = pkgs: pkgs.rust_1_63;
59+60+ rustcPatches = [
61+ ];
62+}
63+64+(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_11" "llvmPackages_14" "llvm_14"])
···430 # This allows build Python to import host Python's sysconfigdata
431 mkdir -p "$out/${sitePackages}"
432 ln -s "$out/lib/${libPrefix}/"_sysconfigdata*.py "$out/${sitePackages}/"
433-434- # debug info can't be separated from a static library and would otherwise be
435- # left in place by a separateDebugInfo build. force its removal here to save
436- # space in output.
437- $STRIP -S $out/lib/${libPrefix}/config-*/libpython*.a || true
438 '' + optionalString stripConfig ''
439 rm -R $out/bin/python*-config $out/lib/python*/config-*
440 '' + optionalString stripIdlelib ''
···1+# Setup hook for unittest.
2+echo "Sourcing unittest-check-hook"
3+4+unittestCheckPhase() {
5+ echo "Executing unittestCheckPhase"
6+ runHook preCheck
7+8+ eval "@pythonCheckInterpreter@ -m unittest discover $unittestFlagsArray"
9+10+ runHook postCheck
11+ echo "Finished executing unittestCheckPhase"
12+}
13+14+if [ -z "${dontUseUnittestCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
15+ echo "Using unittestCheckPhase"
16+ preDistPhases+=" unittestCheckPhase"
17+18+ # It's almost always the case that setuptoolsCheckPhase should not be ran
19+ # when the unittestCheckHook is being ran
20+ if [ -z "${useSetuptoolsCheck-}" ]; then
21+ dontUseSetuptoolsCheck=1
22+23+ # Remove command if already injected into preDistPhases
24+ if [[ "$preDistPhases" =~ "setuptoolsCheckPhase" ]]; then
25+ echo "Removing setuptoolsCheckPhase"
26+ preDistPhases=${preDistPhases/setuptoolsCheckPhase/}
27+ fi
28+ fi
29+fi
···1{ config, lib, stdenv, fetchurl, gettext, meson, ninja, pkg-config, perl, python3
2+, libiconv, zlib, libffi, pcre, libelf, gnome, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45, libxslt
3# use util-linuxMinimal to avoid circular dependency (util-linux, systemd, glib)
4, util-linuxMinimal ? null
5, buildPackages
···124 (buildPackages.meson.override {
125 withDarwinFrameworksGtkDocPatch = stdenv.isDarwin;
126 })
127+ ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2 libxslt
128 ];
129130 propagatedBuildInputs = [ zlib libffi gettext libiconv ];
···135 "-Dgtk_doc=${boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}"
136 "-Dnls=enabled"
137 "-Ddevbindir=${placeholder "dev"}/bin"
138+ ] ++ optionals (!stdenv.isDarwin) [
139+ "-Dman=true" # broken on Darwin
140 ];
141142 NIX_CFLAGS_COMPILE = toString [
···169 # This file is *included* in gtk3 and would introduce runtime reference via __FILE__.
170 sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \
171 -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
172+ for i in $bin/bin/*; do
173+ moveToOutput "share/bash-completion/completions/''${i##*/}" "$bin"
174+ done
175+ for i in $dev/bin/*; do
176+ moveToOutput "share/bash-completion/completions/''${i##*/}" "$dev"
177+ done
178 '' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
179 cp -r ${buildPackages.glib.devdoc} $devdoc
180+ '';
181+182+ # Move man pages to the same output as their binaries (needs to be
183+ # done after preFixupHooks which moves man pages too - in
184+ # _multioutDocs)
185+ postFixup = ''
186+ for i in $dev/bin/*; do
187+ moveToOutput "share/man/man1/''${i##*/}.1.*" "$dev"
188+ done
189 '';
190191 checkInputs = [ tzdata desktop-file-utils shared-mime-info ];
-9
pkgs/development/libraries/glibc/default.nix
···127 ln -sf $out/lib/libdl.so.2 $out/lib/libdl.so
128 ln -sf $out/lib/libutil.so.1 $out/lib/libutil.so
129 touch $out/lib/libpthread.a
130- ''
131- # For some reason these aren't stripped otherwise and retain reference
132- # to bootstrap-tools; on cross-arm this stripping would break objects.
133- + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
134-135- for i in "$out"/lib/*.a; do
136- [ "$i" = "$out/lib/libm.a" ] || $STRIP -S "$i"
137- done
138- '' + ''
139140 # Put libraries for static linking in a separate output. Note
141 # that libc_nonshared.a and libpthread_nonshared.a are required
···127 ln -sf $out/lib/libdl.so.2 $out/lib/libdl.so
128 ln -sf $out/lib/libutil.so.1 $out/lib/libutil.so
129 touch $out/lib/libpthread.a
000000000130131 # Put libraries for static linking in a separate output. Note
132 # that libc_nonshared.a and libpthread_nonshared.a are required
···1-diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh
2-index a710f0c..258eec6 100755
3---- a/src/gen-lock-obj.sh
4-+++ b/src/gen-lock-obj.sh
5-@@ -1,136 +1,136 @@
6- #! /bin/sh
7- #
8- # gen-lock-obj.sh - Build tool to construct the lock object.
9- #
10- # Copyright (C) 2020, 2021 g10 Code GmbH
11- #
12- # This file is part of libgpg-error.
13- #
14- # libgpg-error is free software; you can redistribute it and/or
15- # modify it under the terms of the GNU Lesser General Public License
16- # as published by the Free Software Foundation; either version 2.1 of
17- # the License, or (at your option) any later version.
18- #
19- # libgpg-error is distributed in the hope that it will be useful, but
20- # WITHOUT ANY WARRANTY; without even the implied warranty of
21- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22- # Lesser General Public License for more details.
23- #
24- # You should have received a copy of the GNU Lesser General Public
25- # License along with this program; if not, see <https://www.gnu.org/licenses/>.
26- #
27-28- #
29- # Following variables should be defined to invoke this script
30- #
31- # CC
32- # OBJDUMP
33- # AWK
34- # ac_ext
35- # ac_object
36- # host
37- # LOCK_ABI_VERSION
38- #
39- # An example:
40- #
41- # LOCK_ABI_VERSION=1 host=x86_64-pc-linux-gnu host_alias=x86_64-linux-gnu \
42- # CC=$host_alias-gcc OBJDUMP=$host_alias-objdump ac_ext=c ac_objext=o \
43- # AWK=gawk ./gen-lock-obj.sh
44- #
45-46--if test -n `echo -n`; then
47-+if test -n "`echo -n`"; then
48- ECHO_C='\c'
49- ECHO_N=''
50- else
51- ECHO_C=''
52- ECHO_N='-n'
53- fi
54-55- if test "$1" = --disable-threads; then
56- cat <<EOF
57- ## lock-obj-pub.$host.h - NO LOCK SUPPORT
58- ## File created by gen-lock-obj.sh - DO NOT EDIT
59- ## To be included by mkheader into gpg-error.h
60-61- /* Dummy object - no locking available. */
62- typedef struct
63- {
64- long _vers;
65- } gpgrt_lock_t;
66-67- #define GPGRT_LOCK_INITIALIZER {-1}
68- EOF
69- else
70- AWK_VERSION_OUTPUT=$($AWK 'BEGIN { print PROCINFO["version"] }')
71- if test -n "$AWK_VERSION_OUTPUT"; then
72- # It's GNU awk, which supports PROCINFO.
73- AWK_OPTION=--non-decimal-data
74- fi
75-76- cat <<'EOF' >conftest.$ac_ext
77- #include <pthread.h>
78- pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
79- EOF
80-81- if $CC -c conftest.$ac_ext; then :
82- ac_mtx_size=$($OBJDUMP -j .bss -t conftest.$ac_objext \
83- | $AWK $AWK_OPTION '
84- /mtx$/ { mtx_size = int("0x" $5) }
85- END { print mtx_size }')
86- else
87- echo "Can't determine mutex size"
88- exit 1
89- fi
90- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
91-92- cat <<EOF
93- ## lock-obj-pub.$host.h
94- ## File created by gen-lock-obj.sh - DO NOT EDIT
95- ## To be included by mkheader into gpg-error.h
96-97- typedef struct
98- {
99- long _vers;
100- union {
101- volatile char _priv[$ac_mtx_size];
102- long _x_align;
103- long *_xp_align;
104- } u;
105- } gpgrt_lock_t;
106-107- EOF
108-109- # FIXME: Support different alignment conditions of:
110- #
111- # USE_16BYTE_ALIGNMENT
112- # USE_DOUBLE_FOR_ALIGNMENT
113- # USE_LONG_DOUBLE_FOR_ALIGNMENT
114- #
115-116- echo ${ECHO_N} "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{${ECHO_C}"
117-118- i=0
119- while test "$i" -lt $ac_mtx_size; do
120- if test "$i" -ne 0 -a "$(( $i % 8 ))" -eq 0; then
121- echo ' \'
122- echo ${ECHO_N} " ${ECHO_C}"
123- fi
124- echo ${ECHO_N} "0${ECHO_C}"
125- if test "$i" -lt $(($ac_mtx_size - 1)); then
126- echo ${ECHO_N} ",${ECHO_C}"
127- fi
128- i=$(( i + 1 ))
129- done
130- fi
131-132- cat <<'EOF'
133- }}}
134- ##
135- ## Local Variables:
136- ## mode: c
137- ## buffer-read-only: t
138- ## End:
139- ##
140- EOF
141-142- exit 0
···1-From 5c44459c3b28a9bd3283aaceab7c615f8020c531 Mon Sep 17 00:00:00 2001
2-From: Mark Adler <madler@alumni.caltech.edu>
3-Date: Tue, 17 Apr 2018 22:09:22 -0700
4-Subject: [PATCH 1/2] Fix a bug that can crash deflate on some input when using
5- Z_FIXED.
6-7-This bug was reported by Danilo Ramos of Eideticom, Inc. It has
8-lain in wait 13 years before being found! The bug was introduced
9-in zlib 1.2.2.2, with the addition of the Z_FIXED option. That
10-option forces the use of fixed Huffman codes. For rare inputs with
11-a large number of distant matches, the pending buffer into which
12-the compressed data is written can overwrite the distance symbol
13-table which it overlays. That results in corrupted output due to
14-invalid distances, and can result in out-of-bound accesses,
15-crashing the application.
16-17-The fix here combines the distance buffer and literal/length
18-buffers into a single symbol buffer. Now three bytes of pending
19-buffer space are opened up for each literal or length/distance
20-pair consumed, instead of the previous two bytes. This assures
21-that the pending buffer cannot overwrite the symbol table, since
22-the maximum fixed code compressed length/distance is 31 bits, and
23-since there are four bytes of pending space for every three bytes
24-of symbol space.
25----
26- deflate.c | 74 ++++++++++++++++++++++++++++++++++++++++---------------
27- deflate.h | 25 +++++++++----------
28- trees.c | 50 +++++++++++--------------------------
29- 3 files changed, 79 insertions(+), 70 deletions(-)
30-31-diff --git a/deflate.c b/deflate.c
32-index 425babc..19cba87 100644
33---- a/deflate.c
34-+++ b/deflate.c
35-@@ -255,11 +255,6 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
36- int wrap = 1;
37- static const char my_version[] = ZLIB_VERSION;
38-39-- ushf *overlay;
40-- /* We overlay pending_buf and d_buf+l_buf. This works since the average
41-- * output size for (length,distance) codes is <= 24 bits.
42-- */
43--
44- if (version == Z_NULL || version[0] != my_version[0] ||
45- stream_size != sizeof(z_stream)) {
46- return Z_VERSION_ERROR;
47-@@ -329,9 +324,47 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
48-49- s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
50-51-- overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
52-- s->pending_buf = (uchf *) overlay;
53-- s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
54-+ /* We overlay pending_buf and sym_buf. This works since the average size
55-+ * for length/distance pairs over any compressed block is assured to be 31
56-+ * bits or less.
57-+ *
58-+ * Analysis: The longest fixed codes are a length code of 8 bits plus 5
59-+ * extra bits, for lengths 131 to 257. The longest fixed distance codes are
60-+ * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest
61-+ * possible fixed-codes length/distance pair is then 31 bits total.
62-+ *
63-+ * sym_buf starts one-fourth of the way into pending_buf. So there are
64-+ * three bytes in sym_buf for every four bytes in pending_buf. Each symbol
65-+ * in sym_buf is three bytes -- two for the distance and one for the
66-+ * literal/length. As each symbol is consumed, the pointer to the next
67-+ * sym_buf value to read moves forward three bytes. From that symbol, up to
68-+ * 31 bits are written to pending_buf. The closest the written pending_buf
69-+ * bits gets to the next sym_buf symbol to read is just before the last
70-+ * code is written. At that time, 31*(n-2) bits have been written, just
71-+ * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at
72-+ * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1
73-+ * symbols are written.) The closest the writing gets to what is unread is
74-+ * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and
75-+ * can range from 128 to 32768.
76-+ *
77-+ * Therefore, at a minimum, there are 142 bits of space between what is
78-+ * written and what is read in the overlain buffers, so the symbols cannot
79-+ * be overwritten by the compressed data. That space is actually 139 bits,
80-+ * due to the three-bit fixed-code block header.
81-+ *
82-+ * That covers the case where either Z_FIXED is specified, forcing fixed
83-+ * codes, or when the use of fixed codes is chosen, because that choice
84-+ * results in a smaller compressed block than dynamic codes. That latter
85-+ * condition then assures that the above analysis also covers all dynamic
86-+ * blocks. A dynamic-code block will only be chosen to be emitted if it has
87-+ * fewer bits than a fixed-code block would for the same set of symbols.
88-+ * Therefore its average symbol length is assured to be less than 31. So
89-+ * the compressed data for a dynamic block also cannot overwrite the
90-+ * symbols from which it is being constructed.
91-+ */
92-+
93-+ s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4);
94-+ s->pending_buf_size = (ulg)s->lit_bufsize * 4;
95-96- if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
97- s->pending_buf == Z_NULL) {
98-@@ -340,8 +373,12 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
99- deflateEnd (strm);
100- return Z_MEM_ERROR;
101- }
102-- s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
103-- s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
104-+ s->sym_buf = s->pending_buf + s->lit_bufsize;
105-+ s->sym_end = (s->lit_bufsize - 1) * 3;
106-+ /* We avoid equality with lit_bufsize*3 because of wraparound at 64K
107-+ * on 16 bit machines and because stored blocks are restricted to
108-+ * 64K-1 bytes.
109-+ */
110-111- s->level = level;
112- s->strategy = strategy;
113-@@ -552,7 +589,7 @@ int ZEXPORT deflatePrime (strm, bits, value)
114-115- if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
116- s = strm->state;
117-- if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
118-+ if (s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
119- return Z_BUF_ERROR;
120- do {
121- put = Buf_size - s->bi_valid;
122-@@ -1113,7 +1150,6 @@ int ZEXPORT deflateCopy (dest, source)
123- #else
124- deflate_state *ds;
125- deflate_state *ss;
126-- ushf *overlay;
127-128-129- if (deflateStateCheck(source) || dest == Z_NULL) {
130-@@ -1133,8 +1169,7 @@ int ZEXPORT deflateCopy (dest, source)
131- ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
132- ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
133- ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
134-- overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
135-- ds->pending_buf = (uchf *) overlay;
136-+ ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4);
137-138- if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
139- ds->pending_buf == Z_NULL) {
140-@@ -1148,8 +1183,7 @@ int ZEXPORT deflateCopy (dest, source)
141- zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
142-143- ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
144-- ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
145-- ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
146-+ ds->sym_buf = ds->pending_buf + ds->lit_bufsize;
147-148- ds->l_desc.dyn_tree = ds->dyn_ltree;
149- ds->d_desc.dyn_tree = ds->dyn_dtree;
150-@@ -1925,7 +1959,7 @@ local block_state deflate_fast(s, flush)
151- FLUSH_BLOCK(s, 1);
152- return finish_done;
153- }
154-- if (s->last_lit)
155-+ if (s->sym_next)
156- FLUSH_BLOCK(s, 0);
157- return block_done;
158- }
159-@@ -2056,7 +2090,7 @@ local block_state deflate_slow(s, flush)
160- FLUSH_BLOCK(s, 1);
161- return finish_done;
162- }
163-- if (s->last_lit)
164-+ if (s->sym_next)
165- FLUSH_BLOCK(s, 0);
166- return block_done;
167- }
168-@@ -2131,7 +2165,7 @@ local block_state deflate_rle(s, flush)
169- FLUSH_BLOCK(s, 1);
170- return finish_done;
171- }
172-- if (s->last_lit)
173-+ if (s->sym_next)
174- FLUSH_BLOCK(s, 0);
175- return block_done;
176- }
177-@@ -2170,7 +2204,7 @@ local block_state deflate_huff(s, flush)
178- FLUSH_BLOCK(s, 1);
179- return finish_done;
180- }
181-- if (s->last_lit)
182-+ if (s->sym_next)
183- FLUSH_BLOCK(s, 0);
184- return block_done;
185- }
186-diff --git a/deflate.h b/deflate.h
187-index 23ecdd3..d4cf1a9 100644
188---- a/deflate.h
189-+++ b/deflate.h
190-@@ -217,7 +217,7 @@ typedef struct internal_state {
191- /* Depth of each subtree used as tie breaker for trees of equal frequency
192- */
193-194-- uchf *l_buf; /* buffer for literals or lengths */
195-+ uchf *sym_buf; /* buffer for distances and literals/lengths */
196-197- uInt lit_bufsize;
198- /* Size of match buffer for literals/lengths. There are 4 reasons for
199-@@ -239,13 +239,8 @@ typedef struct internal_state {
200- * - I can't count above 4
201- */
202-203-- uInt last_lit; /* running index in l_buf */
204--
205-- ushf *d_buf;
206-- /* Buffer for distances. To simplify the code, d_buf and l_buf have
207-- * the same number of elements. To use different lengths, an extra flag
208-- * array would be necessary.
209-- */
210-+ uInt sym_next; /* running index in sym_buf */
211-+ uInt sym_end; /* symbol table full when sym_next reaches this */
212-213- ulg opt_len; /* bit length of current block with optimal trees */
214- ulg static_len; /* bit length of current block with static trees */
215-@@ -325,20 +320,22 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
216-217- # define _tr_tally_lit(s, c, flush) \
218- { uch cc = (c); \
219-- s->d_buf[s->last_lit] = 0; \
220-- s->l_buf[s->last_lit++] = cc; \
221-+ s->sym_buf[s->sym_next++] = 0; \
222-+ s->sym_buf[s->sym_next++] = 0; \
223-+ s->sym_buf[s->sym_next++] = cc; \
224- s->dyn_ltree[cc].Freq++; \
225-- flush = (s->last_lit == s->lit_bufsize-1); \
226-+ flush = (s->sym_next == s->sym_end); \
227- }
228- # define _tr_tally_dist(s, distance, length, flush) \
229- { uch len = (uch)(length); \
230- ush dist = (ush)(distance); \
231-- s->d_buf[s->last_lit] = dist; \
232-- s->l_buf[s->last_lit++] = len; \
233-+ s->sym_buf[s->sym_next++] = dist; \
234-+ s->sym_buf[s->sym_next++] = dist >> 8; \
235-+ s->sym_buf[s->sym_next++] = len; \
236- dist--; \
237- s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
238- s->dyn_dtree[d_code(dist)].Freq++; \
239-- flush = (s->last_lit == s->lit_bufsize-1); \
240-+ flush = (s->sym_next == s->sym_end); \
241- }
242- #else
243- # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
244-diff --git a/trees.c b/trees.c
245-index 4f4a650..decaeb7 100644
246---- a/trees.c
247-+++ b/trees.c
248-@@ -416,7 +416,7 @@ local void init_block(s)
249-250- s->dyn_ltree[END_BLOCK].Freq = 1;
251- s->opt_len = s->static_len = 0L;
252-- s->last_lit = s->matches = 0;
253-+ s->sym_next = s->matches = 0;
254- }
255-256- #define SMALLEST 1
257-@@ -948,7 +948,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
258-259- Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
260- opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
261-- s->last_lit));
262-+ s->sym_next / 3));
263-264- if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
265-266-@@ -1017,8 +1017,9 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
267- unsigned dist; /* distance of matched string */
268- unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
269- {
270-- s->d_buf[s->last_lit] = (ush)dist;
271-- s->l_buf[s->last_lit++] = (uch)lc;
272-+ s->sym_buf[s->sym_next++] = dist;
273-+ s->sym_buf[s->sym_next++] = dist >> 8;
274-+ s->sym_buf[s->sym_next++] = lc;
275- if (dist == 0) {
276- /* lc is the unmatched char */
277- s->dyn_ltree[lc].Freq++;
278-@@ -1033,30 +1034,7 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
279- s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
280- s->dyn_dtree[d_code(dist)].Freq++;
281- }
282--
283--#ifdef TRUNCATE_BLOCK
284-- /* Try to guess if it is profitable to stop the current block here */
285-- if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
286-- /* Compute an upper bound for the compressed length */
287-- ulg out_length = (ulg)s->last_lit*8L;
288-- ulg in_length = (ulg)((long)s->strstart - s->block_start);
289-- int dcode;
290-- for (dcode = 0; dcode < D_CODES; dcode++) {
291-- out_length += (ulg)s->dyn_dtree[dcode].Freq *
292-- (5L+extra_dbits[dcode]);
293-- }
294-- out_length >>= 3;
295-- Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
296-- s->last_lit, in_length, out_length,
297-- 100L - out_length*100L/in_length));
298-- if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
299-- }
300--#endif
301-- return (s->last_lit == s->lit_bufsize-1);
302-- /* We avoid equality with lit_bufsize because of wraparound at 64K
303-- * on 16 bit machines and because stored blocks are restricted to
304-- * 64K-1 bytes.
305-- */
306-+ return (s->sym_next == s->sym_end);
307- }
308-309- /* ===========================================================================
310-@@ -1069,13 +1047,14 @@ local void compress_block(s, ltree, dtree)
311- {
312- unsigned dist; /* distance of matched string */
313- int lc; /* match length or unmatched char (if dist == 0) */
314-- unsigned lx = 0; /* running index in l_buf */
315-+ unsigned sx = 0; /* running index in sym_buf */
316- unsigned code; /* the code to send */
317- int extra; /* number of extra bits to send */
318-319-- if (s->last_lit != 0) do {
320-- dist = s->d_buf[lx];
321-- lc = s->l_buf[lx++];
322-+ if (s->sym_next != 0) do {
323-+ dist = s->sym_buf[sx++] & 0xff;
324-+ dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
325-+ lc = s->sym_buf[sx++];
326- if (dist == 0) {
327- send_code(s, lc, ltree); /* send a literal byte */
328- Tracecv(isgraph(lc), (stderr," '%c' ", lc));
329-@@ -1100,11 +1079,10 @@ local void compress_block(s, ltree, dtree)
330- }
331- } /* literal or match pair ? */
332-333-- /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
334-- Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
335-- "pendingBuf overflow");
336-+ /* Check that the overlay between pending_buf and sym_buf is ok: */
337-+ Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
338-339-- } while (lx < s->last_lit);
340-+ } while (sx < s->sym_next);
341-342- send_code(s, END_BLOCK, ltree);
343- }
344---
345-2.33.1
346-
···1+From eff308af425b67093bab25f80f1ae950166bece1 Mon Sep 17 00:00:00 2001
2+From: Mark Adler <fork@madler.net>
3+Date: Sat, 30 Jul 2022 15:51:11 -0700
4+Subject: [PATCH] Fix a bug when getting a gzip header extra field with
5+ inflate().
6+7+If the extra field was larger than the space the user provided with
8+inflateGetHeader(), and if multiple calls of inflate() delivered
9+the extra header data, then there could be a buffer overflow of the
10+provided space. This commit assures that provided space is not
11+exceeded.
12+---
13+ inflate.c | 5 +++--
14+ 1 file changed, 3 insertions(+), 2 deletions(-)
15+16+diff --git a/inflate.c b/inflate.c
17+index 7be8c6366..7a7289749 100644
18+--- a/inflate.c
19++++ b/inflate.c
20+@@ -763,9 +763,10 @@ int flush;
21+ copy = state->length;
22+ if (copy > have) copy = have;
23+ if (copy) {
24++ len = state->head->extra_len - state->length;
25+ if (state->head != Z_NULL &&
26+- state->head->extra != Z_NULL) {
27+- len = state->head->extra_len - state->length;
28++ state->head->extra != Z_NULL &&
29++ len < state->head->extra_max) {
30+ zmemcpy(state->head->extra + len, next,
31+ len + copy > state->head->extra_max ?
32+ state->head->extra_max - len : copy);
33+34+From 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Mon Sep 17 00:00:00 2001
35+From: Mark Adler <fork@madler.net>
36+Date: Mon, 8 Aug 2022 10:50:09 -0700
37+Subject: [PATCH] Fix extra field processing bug that dereferences NULL
38+ state->head.
39+40+The recent commit to fix a gzip header extra field processing bug
41+introduced the new bug fixed here.
42+---
43+ inflate.c | 4 ++--
44+ 1 file changed, 2 insertions(+), 2 deletions(-)
45+46+diff --git a/inflate.c b/inflate.c
47+index 7a7289749..2a3c4fe98 100644
48+--- a/inflate.c
49++++ b/inflate.c
50+@@ -763,10 +763,10 @@ int flush;
51+ copy = state->length;
52+ if (copy > have) copy = have;
53+ if (copy) {
54+- len = state->head->extra_len - state->length;
55+ if (state->head != Z_NULL &&
56+ state->head->extra != Z_NULL &&
57+- len < state->head->extra_max) {
58++ (len = state->head->extra_len - state->length) <
59++ state->head->extra_max) {
60+ zmemcpy(state->head->extra + len, next,
61+ len + copy > state->head->extra_max ?
62+ state->head->extra_max - len : copy);
+1
pkgs/development/libraries/zlib/default.nix
···48 # TODO: remove the patch if upstream releases https://github.com/madler/zlib/commit/ec3df00224d4b396e2ac6586ab5d25f673caa4c2
49 # see https://github.com/NixOS/nixpkgs/issues/170539 for history.
50 ./comprehensive-crc-validation-for-wrong-implementations.patch
051 ];
5253 strictDeps = true;
···48 # TODO: remove the patch if upstream releases https://github.com/madler/zlib/commit/ec3df00224d4b396e2ac6586ab5d25f673caa4c2
49 # see https://github.com/NixOS/nixpkgs/issues/170539 for history.
50 ./comprehensive-crc-validation-for-wrong-implementations.patch
51+ ./CVE-2022-37434.patch
52 ];
5354 strictDeps = true;
···9, regex
10, tabview
11, python
012}:
1314buildPythonPackage rec {
···33 tabview
34 ];
350036 pythonImportsCheck = [
37 "clevercsv"
38 "clevercsv.cparser"
39 ];
4041- checkPhase = ''
42 # by linking the installed version the tests also have access to compiled native libraries
43 rm -r clevercsv
44 ln -s $out/${python.sitePackages}/clevercsv/ clevercsv
45- # their ci only runs unit tests, there are also integration and fuzzing tests
46- ${python.interpreter} -m unittest discover -v -f -s ./tests/test_unit
47 '';
0004849 meta = with lib; {
50 description = "CleverCSV is a Python package for handling messy CSV files";
51 longDescription = ''
52- CleverCSV is a Python package for handling messy CSV files. It provides
53- a drop-in replacement for the builtin CSV module with improved dialect
54- detection, and comes with a handy command line application for working
55- with CSV files.
56 '';
57 homepage = "https://github.com/alan-turing-institute/CleverCSV";
58 changelog = "https://github.com/alan-turing-institute/CleverCSV/blob/master/CHANGELOG.md";
···9, regex
10, tabview
11, python
12+, unittestCheckHook
13}:
1415buildPythonPackage rec {
···34 tabview
35 ];
3637+ checkInputs = [ unittestCheckHook ];
38+39 pythonImportsCheck = [
40 "clevercsv"
41 "clevercsv.cparser"
42 ];
4344+ preCheck = ''
45 # by linking the installed version the tests also have access to compiled native libraries
46 rm -r clevercsv
47 ln -s $out/${python.sitePackages}/clevercsv/ clevercsv
0048 '';
49+50+ # their ci only runs unit tests, there are also integration and fuzzing tests
51+ unittestFlagsArray = [ "-v" "-f" "-s" "./tests/test_unit" ];
5253 meta = with lib; {
54 description = "CleverCSV is a Python package for handling messy CSV files";
55 longDescription = ''
56+ CleverCSV is a Python package for handling messy CSV files. It provides
57+ a drop-in replacement for the builtin CSV module with improved dialect
58+ detection, and comes with a handy command line application for working
59+ with CSV files.
60 '';
61 homepage = "https://github.com/alan-turing-institute/CleverCSV";
62 changelog = "https://github.com/alan-turing-institute/CleverCSV/blob/master/CHANGELOG.md";
···1---- a/mesonbuild/coredata.py
2-+++ b/mesonbuild/coredata.py
3-@@ -506,7 +506,6 @@ class CoreData:
4- return value
5- if option.name.endswith('dir') and value.is_absolute() and \
6- option not in BULITIN_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-@@ -518,7 +517,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()
···1011python3.pkgs.buildPythonApplication rec {
12 pname = "meson";
13- version = "0.61.2";
1415 src = python3.pkgs.fetchPypi {
16 inherit pname version;
17- hash = "sha256-AjOn+NlZB5MY9gUrCTnCf2il3oa6YB8lye5oaftfWIk=";
18 };
1920 patches = [
21- # Upstream insists on not allowing bindir and other dir options
22- # outside of prefix for some reason:
23- # https://github.com/mesonbuild/meson/issues/2561
24- # We remove the check so multiple outputs can work sanely.
25- ./allow-dirs-outside-of-prefix.patch
26-27 # Meson is currently inspecting fewer variables than autoconf does, which
28 # makes it harder for us to use setup hooks, etc. Taken from
29 # https://github.com/mesonbuild/meson/pull/6827
30 ./more-env-vars.patch
31-32- # Use more binutils variables, so we don't have to define them in stdenv.
33- # pr has been merged
34- # https://github.com/mesonbuild/meson/pull/10640
35- (fetchpatch {
36- url = "https://github.com/mesonbuild/meson/commit/8a8ab9a8e0c2cefb6faa0734e52803c74790576c.patch";
37- sha256 = "sha256-BdBf1NB4SZLFyFRDzD0p//XUgUeAHpo6XXUtsHdCgKE=";
38- })
3940 # Unlike libtool, vanilla Meson does not pass any information
41 # about the path library will be installed to to g-ir-scanner,
···67 # https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774
68 ./boost-Do-not-add-system-paths-on-nix.patch
6970- # https://github.com/mesonbuild/meson/pull/9841
71- # cross-compilation fix
072 (fetchpatch {
73- url = "https://github.com/mesonbuild/meson/commit/266e8acb5807b38a550cb5145cea0e19545a21d7.patch";
74- sha256 = "sha256-1GdKsm2xvq2GxTNeTyBH5O73hxboL0YI+w2BCoUeWXM=";
0000000000075 })
76- ] ++ lib.optionals withDarwinFrameworksGtkDocPatch [
77- # Fix building gtkdoc for GLib
78- # https://github.com/mesonbuild/meson/pull/10186
79- ./fix-gtkdoc-when-using-multiple-apple-frameworks.patch
80 ];
8182 setupHook = ./setup-hook.sh;
···1011python3.pkgs.buildPythonApplication rec {
12 pname = "meson";
13+ version = "0.63.1";
1415 src = python3.pkgs.fetchPypi {
16 inherit pname version;
17+ sha256 = "Bv4TKXIT1v8BIcXVqrJaVu+Tj/7FdBTtYIb9onLLZek=";
18 };
1920 patches = [
00000021 # Meson is currently inspecting fewer variables than autoconf does, which
22 # makes it harder for us to use setup hooks, etc. Taken from
23 # https://github.com/mesonbuild/meson/pull/6827
24 ./more-env-vars.patch
000000002526 # Unlike libtool, vanilla Meson does not pass any information
27 # about the path library will be installed to to g-ir-scanner,
···53 # https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774
54 ./boost-Do-not-add-system-paths-on-nix.patch
5556+ # Prevent Meson from passing -O0 in buildtype=plain.
57+ # Nixpkgs enables fortifications which do not work without optimizations.
58+ # https://github.com/mesonbuild/meson/pull/10593
59 (fetchpatch {
60+ url = "https://github.com/mesonbuild/meson/commit/f9bfeb2add70973113ab4a98454a5c5d7e3a26ae.patch";
61+ revert = true;
62+ sha256 = "VKXUwdS+zMp1y+5GrV2inESUpUUp+OL3aI4wOXHxOeo=";
63+ })
64+65+ # Fix passing multiple --define-variable arguments to pkg-config.
66+ # https://github.com/mesonbuild/meson/pull/10670
67+ (fetchpatch {
68+ url = "https://github.com/mesonbuild/meson/commit/d5252c5d4cf1c1931fef0c1c98dd66c000891d21.patch";
69+ sha256 = "GiUNVul1N5Fl8mfqM7vA/r1FdKqImiDYLXMVDt77gvw=";
70+ excludes = [
71+ "docs/yaml/objects/dep.yaml"
72+ ];
73 })
000074 ];
7576 setupHook = ./setup-hook.sh;
···22in
23stdenv.mkDerivation rec {
24 pname = "vulkan-validation-layers";
25- version = "1.3.211.0";
2627 # If we were to use "dev" here instead of headers, the setupHook would be
28 # placed in that output instead of "out".
···34 owner = "KhronosGroup";
35 repo = "Vulkan-ValidationLayers";
36 rev = "sdk-${version}";
37- sha256 = "sha256-NGpFfekZtB0rvnGxYVDo808xzgBuo8ZC4bjXjQnTpxU=";
38 });
3940 # Include absolute paths to layer libraries in their associated
···22in
23stdenv.mkDerivation rec {
24 pname = "vulkan-validation-layers";
25+ version = "1.3.216.0";
2627 # If we were to use "dev" here instead of headers, the setupHook would be
28 # placed in that output instead of "out".
···34 owner = "KhronosGroup";
35 repo = "Vulkan-ValidationLayers";
36 rev = "sdk-${version}";
37+ hash = "sha256-ri6ImAuskbvYL/ZM8kaVDZRP2v1qfSaafVacwwRF424=";
38 });
3940 # Include absolute paths to layer libraries in their associated
···23stdenv.mkDerivation rec {
24 pname = "vulkan-tools-lunarg";
25 # The version must match that in vulkan-headers
26- version = "1.3.211.0";
2728 src = (assert version == vulkan-headers.version;
29 fetchFromGitHub {
30 owner = "LunarG";
31 repo = "VulkanTools";
32 rev = "sdk-${version}";
33- sha256 = "sha256-Pkz2FV0AnTKm/4jVmkQNkYzpxpKJaSoy2fRAhVh5OKU=";
34 fetchSubmodules = true;
35 });
36
···23stdenv.mkDerivation rec {
24 pname = "vulkan-tools-lunarg";
25 # The version must match that in vulkan-headers
26+ version = "1.3.216.0";
2728 src = (assert version == vulkan-headers.version;
29 fetchFromGitHub {
30 owner = "LunarG";
31 repo = "VulkanTools";
32 rev = "sdk-${version}";
33+ hash = "sha256-NhYQSL5iU7iSO5Q6lp1iwhbi5GEfD11MDmBn9Uk1jm0=";
34 fetchSubmodules = true;
35 });
36
+2-2
pkgs/tools/graphics/vulkan-tools/default.nix
···2122stdenv.mkDerivation rec {
23 pname = "vulkan-tools";
24- version = "1.3.211.0";
2526 # It's not strictly necessary to have matching versions here, however
27 # since we're using the SDK version we may as well be consistent with
···31 owner = "KhronosGroup";
32 repo = "Vulkan-Tools";
33 rev = "sdk-${version}";
34- sha256 = "sha256-iXsWTKNllPZy1Kpo3JHzEEus3Hu9LofvMB3c4Gn6/DM=";
35 });
3637 nativeBuildInputs = [
···2122stdenv.mkDerivation rec {
23 pname = "vulkan-tools";
24+ version = "1.3.216.0";
2526 # It's not strictly necessary to have matching versions here, however
27 # since we're using the SDK version we may as well be consistent with
···31 owner = "KhronosGroup";
32 repo = "Vulkan-Tools";
33 rev = "sdk-${version}";
34+ hash = "sha256-VEMeURNboiOwPGrtFGUt9ZyChj8pV0xcpydrarcwtF0=";
35 });
3637 nativeBuildInputs = [
+2-2
pkgs/tools/misc/man-db/default.nix
···2, db
3, fetchurl
4, groff
05, lib
6, libiconv
7, libpipeline
···68 # make sure that we don't wrap symlinks (since that changes argv[0] to the -wrapped name)
69 find "$out/bin" -type f | while read file; do
70 wrapProgram "$file" \
71- --prefix PATH : "${lib.getBin groff}/bin" \
72- --prefix PATH : "${lib.getBin zstd}/bin"
73 done
74 '';
75
···2, db
3, fetchurl
4, groff
5+, gzip
6, lib
7, libiconv
8, libpipeline
···69 # make sure that we don't wrap symlinks (since that changes argv[0] to the -wrapped name)
70 find "$out/bin" -type f | while read file; do
71 wrapProgram "$file" \
72+ --prefix PATH : "${lib.makeBinPath [ groff gzip zstd ]}"
073 done
74 '';
75