···734734with the exception of `other` (see `format` in
735735[`buildPythonPackage` parameters](#buildpythonpackage-parameters) for more details).
736736737737+### Using unittestCheckHook {#using-unittestcheckhook}
738738+739739+`unittestCheckHook` is a hook which will substitute the setuptools `test` command for a `checkPhase` which runs `python -m unittest discover`:
740740+741741+```
742742+ checkInputs = [ unittestCheckHook ];
743743+744744+ unittestFlags = [ "-s" "tests" "-v" ];
745745+```
746746+737747### Develop local package {#develop-local-package}
738748739749As a Python developer you're likely aware of [development mode](http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode)
···12701280 with the `pipInstallHook`.
12711281- `pythonRelaxDepsHook` will relax Python dependencies restrictions for the package.
12721282 See [example usage](#using-pythonrelaxdepshook).
12831283+- `unittestCheckHook` will run tests with `python -m unittest discover`. See [example usage](#using-unittestcheckhook).
1273128412741285### Development mode {#development-mode}
12751286
+7-1
lib/systems/default.nix
···6565 # is why we use the more obscure "bfd" and not "binutils" for this
6666 # choice.
6767 else "bfd";
6868- extensions = {
6868+ extensions = rec {
6969 sharedLibrary =
7070 /**/ if final.isDarwin then ".dylib"
7171 else if final.isWindows then ".dll"
7272 else ".so";
7373+ staticLibrary =
7474+ /**/ if final.isWindows then ".lib"
7575+ else ".a";
7676+ library =
7777+ /**/ if final.isStatic then staticLibrary
7878+ else sharedLibrary;
7379 executable =
7480 /**/ if final.isWindows then ".exe"
7581 else "";
···3838stripDirs() {
3939 local cmd="$1"
4040 local ranlibCmd="$2"
4141- local dirs="$3"
4141+ local paths="$3"
4242 local stripFlags="$4"
4343- local dirsNew=
4343+ local pathsNew=
44444545- local d
4646- for d in ${dirs}; do
4747- if [ -d "$prefix/$d" ]; then
4848- dirsNew="${dirsNew} $prefix/$d "
4545+ local p
4646+ for p in ${paths}; do
4747+ if [ -e "$prefix/$p" ]; then
4848+ pathsNew="${pathsNew} $prefix/$p"
4949 fi
5050 done
5151- dirs=${dirsNew}
5151+ paths=${pathsNew}
52525353- if [ -n "${dirs}" ]; then
5454- echo "stripping (with command $cmd and flags $stripFlags) in$dirs"
5555- find $dirs -type f -exec $cmd $stripFlags '{}' \; 2>/dev/null
5353+ if [ -n "${paths}" ]; then
5454+ echo "stripping (with command $cmd and flags $stripFlags) in $paths"
5555+ # Do not strip lib/debug. This is a directory used by setup-hooks/separate-debug-info.sh.
5656+ find $paths -type f -a '!' -wholename "$prefix/lib/debug/*" -exec $cmd $stripFlags '{}' \; 2>/dev/null
5657 # 'strip' does not normally preserve archive index in .a files.
5758 # This usually causes linking failures against static libs like:
5859 # ld: ...-i686-w64-mingw32-stage-final-gcc-13.0.0-lib/i686-w64-mingw32/lib/libstdc++.dll.a:
5960 # error adding symbols: archive has no index; run ranlib to add one
6061 # Restore the index by running 'ranlib'.
6161- find $dirs -name '*.a' -type f -exec $ranlibCmd '{}' \; 2>/dev/null
6262+ find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2>/dev/null
6263 fi
6364}
···11+diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
22+index 4ea029dbde..af94a4d90b 100644
33+--- a/src/time/zoneinfo_unix.go
44++++ b/src/time/zoneinfo_unix.go
55+@@ -20,6 +20,7 @@ import (
66+ // Many systems use /usr/share/zoneinfo, Solaris 2 has
77+ // /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ.
88+ var zoneSources = []string{
99++ "@tzdata@/share/zoneinfo/",
1010+ "/usr/share/zoneinfo/",
1111+ "/usr/share/lib/zoneinfo/",
1212+ "/usr/lib/locale/TZ/",
+12
pkgs/development/compilers/go/tzdata-1.19.patch
···11+diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
22+index 67b8beb47b..5cd1fb1759 100644
33+--- a/src/time/zoneinfo_unix.go
44++++ b/src/time/zoneinfo_unix.go
55+@@ -18,6 +18,7 @@ import (
66+ // Many systems use /usr/share/zoneinfo, Solaris 2 has
77+ // /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ.
88+ var platformZoneSources = []string{
99++ "@tzdata@/share/zoneinfo/",
1010+ "/usr/share/zoneinfo/",
1111+ "/usr/share/lib/zoneinfo/",
1212+ "/usr/lib/locale/TZ/",
-64
pkgs/development/compilers/rust/1_62.nix
···11-# New rust versions should first go to staging.
22-# Things to check after updating:
33-# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
44-# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
55-# This testing can be also done by other volunteers as part of the pull
66-# request review, in case platforms cannot be covered.
77-# 2. The LLVM version used for building should match with rust upstream.
88-# Check the version number in the src/llvm-project git submodule in:
99-# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
1010-# 3. Firefox and Thunderbird should still build on x86_64-linux.
1111-1212-{ stdenv, lib
1313-, buildPackages
1414-, newScope, callPackage
1515-, CoreFoundation, Security, SystemConfiguration
1616-, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
1717-, makeRustPlatform
1818-, llvmPackages_11
1919-, llvmPackages_14, llvm_14
2020-} @ args:
2121-2222-import ./default.nix {
2323- rustcVersion = "1.62.1";
2424- rustcSha256 = "sha256-cqy+b/zZT1mDgqdDCw2F7o9nnm0LJ/P1Zu0cFsl4Ez8=";
2525-2626- llvmSharedForBuild = pkgsBuildBuild.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
2727- llvmSharedForHost = pkgsBuildHost.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
2828- llvmSharedForTarget = pkgsBuildTarget.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
2929-3030- llvmBootstrapForDarwin = llvmPackages_11;
3131-3232- # For use at runtime
3333- llvmShared = llvm_14.override { enableSharedLibraries = true; };
3434-3535- # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox
3636- llvmPackages = llvmPackages_14;
3737-3838- # Note: the version MUST be one version prior to the version we're
3939- # building
4040- bootstrapVersion = "1.61.0";
4141-4242- # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
4343- bootstrapHashes = {
4444- i686-unknown-linux-gnu = "b15eb0ad44b7253e0b5b1a8cd285feb10e9fb0402840dba9a13112c3349a4b39";
4545- x86_64-unknown-linux-gnu = "066b324239d30787ce64142d7e04912f2e1850c07db3b2354d8654e02ff8b23a";
4646- x86_64-unknown-linux-musl = "0904f6b769ae28c259e0e25a41e99290a4ae2a36bca63ae153790b2ebbc427bf";
4747- arm-unknown-linux-gnueabihf = "cc32705cd1b583aaac74e6663f71392131dc0355a0f484cb56f0378b71ea7ebc";
4848- armv7-unknown-linux-gnueabihf = "2782ec75ea4abb402513e2e57becc6c14e67b492d57228cddedef6db0853b165";
4949- aarch64-unknown-linux-gnu = "261cd47bc3c98c9f97b601d1ad2a7d9b33c9ea63c9a351119c2f6d4e82f5d436";
5050- aarch64-unknown-linux-musl = "feb79985cb161a10b252236852df8db3bf3593c78905b84c7e94cd4454327e47";
5151- x86_64-apple-darwin = "d851f1a473926a5d8f111ed08002047a5dc4ad944a5b7f8d5d2f1f266b51e66a";
5252- aarch64-apple-darwin = "2dbafd13d007543aada47179fa273f9a3865f27e0a07bd69be61801232a0819e";
5353- powerpc64le-unknown-linux-gnu = "6d5cd579b68a2adc20384406c69a92beaaf4941056e126ff0ed1ec2f3a4e721f";
5454- riscv64gc-unknown-linux-gnu = "3d0f3b1a8522e09fffdf920a061794ac3107410eb1fe8f5d62a7aae3c6dcb81e";
5555- mips64el-unknown-linux-gnuabi64 = "6ed5b6492e68f45488108abd06dbcd4b89c46cdbd4715331bb11e88f18500815";
5656- };
5757-5858- selectRustPackage = pkgs: pkgs.rust_1_62;
5959-6060- rustcPatches = [
6161- ];
6262-}
6363-6464-(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_11" "llvmPackages_14" "llvm_14"])
+64
pkgs/development/compilers/rust/1_63.nix
···11+# New rust versions should first go to staging.
22+# Things to check after updating:
33+# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
44+# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
55+# This testing can be also done by other volunteers as part of the pull
66+# request review, in case platforms cannot be covered.
77+# 2. The LLVM version used for building should match with rust upstream.
88+# Check the version number in the src/llvm-project git submodule in:
99+# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
1010+# 3. Firefox and Thunderbird should still build on x86_64-linux.
1111+1212+{ stdenv, lib
1313+, buildPackages
1414+, newScope, callPackage
1515+, CoreFoundation, Security, SystemConfiguration
1616+, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
1717+, makeRustPlatform
1818+, llvmPackages_11
1919+, llvmPackages_14, llvm_14
2020+} @ args:
2121+2222+import ./default.nix {
2323+ rustcVersion = "1.63.0";
2424+ rustcSha256 = "1l4rrbzhxv88pnfq94nbyb9m6lfnjwixma3mwjkmvvs2aqlq158z";
2525+2626+ llvmSharedForBuild = pkgsBuildBuild.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
2727+ llvmSharedForHost = pkgsBuildHost.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
2828+ llvmSharedForTarget = pkgsBuildTarget.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
2929+3030+ llvmBootstrapForDarwin = llvmPackages_11;
3131+3232+ # For use at runtime
3333+ llvmShared = llvm_14.override { enableSharedLibraries = true; };
3434+3535+ # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox
3636+ llvmPackages = llvmPackages_14;
3737+3838+ # Note: the version MUST be one version prior to the version we're
3939+ # building
4040+ bootstrapVersion = "1.62.1";
4141+4242+ # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
4343+ bootstrapHashes = {
4444+ i686-unknown-linux-gnu = "1669163ffe01e252ffb62da7d84949378fc274931a65ac827d54059a5ffc542c";
4545+ x86_64-unknown-linux-gnu = "dd7d82b8fa8eae59729e1c31fe59a9de6ee61d08ab40ce016185653beebe04d2";
4646+ x86_64-unknown-linux-musl = "32bee487074b105e2582cddce35934a6019eec74bae3f9300fdc3edfcf5b66d4";
4747+ arm-unknown-linux-gnueabihf = "5c735e8174d394936d7b499c2d147ddadf3c4d77e652d1e0b0a72d9d09f81ea4";
4848+ armv7-unknown-linux-gnueabihf = "26fa731385f1a71211ba8e3c94f3bb3b1a82bde89f8d4dcf75b4b463b57b0f88";
4949+ aarch64-unknown-linux-gnu = "1311fa8204f895d054c23a3481de3b158a5cd3b3a6338761fee9cdf4dbf075a5";
5050+ aarch64-unknown-linux-musl = "73bbab4d8a9e3c416035d40406e656ab37e785df35fa069a33af52e931a24b12";
5151+ x86_64-apple-darwin = "0a04dcf2b521239826f3eaa66d77169d91e68087ccc3107b54e8aba7c02c9adf";
5252+ aarch64-apple-darwin = "6d1671ea31b05cab5e2587cc2b295b3e7232b0135f0977355618e2a01933ff0a";
5353+ powerpc64le-unknown-linux-gnu = "1d3248e1a673cda87cf443cd4334ff5fb53e6f87c72d3587b07e5c0cb507f3ae";
5454+ riscv64gc-unknown-linux-gnu = "fd378d0bf866689e8111aba0e2b020da87f32f70fb11d98a575d42dc05978c2a";
5555+ mips64el-unknown-linux-gnuabi64 = "b7c47dd94728161aa96762fb7bc51b6ab0feba7c5215d06eaea5b78649815a96";
5656+ };
5757+5858+ selectRustPackage = pkgs: pkgs.rust_1_63;
5959+6060+ rustcPatches = [
6161+ ];
6262+}
6363+6464+(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_11" "llvmPackages_14" "llvm_14"])
···430430 # This allows build Python to import host Python's sysconfigdata
431431 mkdir -p "$out/${sitePackages}"
432432 ln -s "$out/lib/${libPrefix}/"_sysconfigdata*.py "$out/${sitePackages}/"
433433-434434- # debug info can't be separated from a static library and would otherwise be
435435- # left in place by a separateDebugInfo build. force its removal here to save
436436- # space in output.
437437- $STRIP -S $out/lib/${libPrefix}/config-*/libpython*.a || true
438433 '' + optionalString stripConfig ''
439434 rm -R $out/bin/python*-config $out/lib/python*/config-*
440435 '' + optionalString stripIdlelib ''
···11+# Setup hook for unittest.
22+echo "Sourcing unittest-check-hook"
33+44+unittestCheckPhase() {
55+ echo "Executing unittestCheckPhase"
66+ runHook preCheck
77+88+ eval "@pythonCheckInterpreter@ -m unittest discover $unittestFlagsArray"
99+1010+ runHook postCheck
1111+ echo "Finished executing unittestCheckPhase"
1212+}
1313+1414+if [ -z "${dontUseUnittestCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
1515+ echo "Using unittestCheckPhase"
1616+ preDistPhases+=" unittestCheckPhase"
1717+1818+ # It's almost always the case that setuptoolsCheckPhase should not be ran
1919+ # when the unittestCheckHook is being ran
2020+ if [ -z "${useSetuptoolsCheck-}" ]; then
2121+ dontUseSetuptoolsCheck=1
2222+2323+ # Remove command if already injected into preDistPhases
2424+ if [[ "$preDistPhases" =~ "setuptoolsCheckPhase" ]]; then
2525+ echo "Removing setuptoolsCheckPhase"
2626+ preDistPhases=${preDistPhases/setuptoolsCheckPhase/}
2727+ fi
2828+ fi
2929+fi
···11{ config, lib, stdenv, fetchurl, gettext, meson, ninja, pkg-config, perl, python3
22-, libiconv, zlib, libffi, pcre, libelf, gnome, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45
22+, libiconv, zlib, libffi, pcre, libelf, gnome, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45, libxslt
33# use util-linuxMinimal to avoid circular dependency (util-linux, systemd, glib)
44, util-linuxMinimal ? null
55, buildPackages
···124124 (buildPackages.meson.override {
125125 withDarwinFrameworksGtkDocPatch = stdenv.isDarwin;
126126 })
127127- ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2
127127+ ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2 libxslt
128128 ];
129129130130 propagatedBuildInputs = [ zlib libffi gettext libiconv ];
···135135 "-Dgtk_doc=${boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}"
136136 "-Dnls=enabled"
137137 "-Ddevbindir=${placeholder "dev"}/bin"
138138+ ] ++ optionals (!stdenv.isDarwin) [
139139+ "-Dman=true" # broken on Darwin
138140 ];
139141140142 NIX_CFLAGS_COMPILE = toString [
···167169 # This file is *included* in gtk3 and would introduce runtime reference via __FILE__.
168170 sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \
169171 -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
172172+ for i in $bin/bin/*; do
173173+ moveToOutput "share/bash-completion/completions/''${i##*/}" "$bin"
174174+ done
175175+ for i in $dev/bin/*; do
176176+ moveToOutput "share/bash-completion/completions/''${i##*/}" "$dev"
177177+ done
170178 '' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
171179 cp -r ${buildPackages.glib.devdoc} $devdoc
180180+ '';
181181+182182+ # Move man pages to the same output as their binaries (needs to be
183183+ # done after preFixupHooks which moves man pages too - in
184184+ # _multioutDocs)
185185+ postFixup = ''
186186+ for i in $dev/bin/*; do
187187+ moveToOutput "share/man/man1/''${i##*/}.1.*" "$dev"
188188+ done
172189 '';
173190174191 checkInputs = [ tzdata desktop-file-utils shared-mime-info ];
-9
pkgs/development/libraries/glibc/default.nix
···127127 ln -sf $out/lib/libdl.so.2 $out/lib/libdl.so
128128 ln -sf $out/lib/libutil.so.1 $out/lib/libutil.so
129129 touch $out/lib/libpthread.a
130130- ''
131131- # For some reason these aren't stripped otherwise and retain reference
132132- # to bootstrap-tools; on cross-arm this stripping would break objects.
133133- + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
134134-135135- for i in "$out"/lib/*.a; do
136136- [ "$i" = "$out/lib/libm.a" ] || $STRIP -S "$i"
137137- done
138138- '' + ''
139130140131 # Put libraries for static linking in a separate output. Note
141132 # that libc_nonshared.a and libpthread_nonshared.a are required
···11-diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh
22-index a710f0c..258eec6 100755
33---- a/src/gen-lock-obj.sh
44-+++ b/src/gen-lock-obj.sh
55-@@ -1,136 +1,136 @@
66- #! /bin/sh
77- #
88- # gen-lock-obj.sh - Build tool to construct the lock object.
99- #
1010- # Copyright (C) 2020, 2021 g10 Code GmbH
1111- #
1212- # This file is part of libgpg-error.
1313- #
1414- # libgpg-error is free software; you can redistribute it and/or
1515- # modify it under the terms of the GNU Lesser General Public License
1616- # as published by the Free Software Foundation; either version 2.1 of
1717- # the License, or (at your option) any later version.
1818- #
1919- # libgpg-error is distributed in the hope that it will be useful, but
2020- # WITHOUT ANY WARRANTY; without even the implied warranty of
2121- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2222- # Lesser General Public License for more details.
2323- #
2424- # You should have received a copy of the GNU Lesser General Public
2525- # License along with this program; if not, see <https://www.gnu.org/licenses/>.
2626- #
2727-2828- #
2929- # Following variables should be defined to invoke this script
3030- #
3131- # CC
3232- # OBJDUMP
3333- # AWK
3434- # ac_ext
3535- # ac_object
3636- # host
3737- # LOCK_ABI_VERSION
3838- #
3939- # An example:
4040- #
4141- # LOCK_ABI_VERSION=1 host=x86_64-pc-linux-gnu host_alias=x86_64-linux-gnu \
4242- # CC=$host_alias-gcc OBJDUMP=$host_alias-objdump ac_ext=c ac_objext=o \
4343- # AWK=gawk ./gen-lock-obj.sh
4444- #
4545-4646--if test -n `echo -n`; then
4747-+if test -n "`echo -n`"; then
4848- ECHO_C='\c'
4949- ECHO_N=''
5050- else
5151- ECHO_C=''
5252- ECHO_N='-n'
5353- fi
5454-5555- if test "$1" = --disable-threads; then
5656- cat <<EOF
5757- ## lock-obj-pub.$host.h - NO LOCK SUPPORT
5858- ## File created by gen-lock-obj.sh - DO NOT EDIT
5959- ## To be included by mkheader into gpg-error.h
6060-6161- /* Dummy object - no locking available. */
6262- typedef struct
6363- {
6464- long _vers;
6565- } gpgrt_lock_t;
6666-6767- #define GPGRT_LOCK_INITIALIZER {-1}
6868- EOF
6969- else
7070- AWK_VERSION_OUTPUT=$($AWK 'BEGIN { print PROCINFO["version"] }')
7171- if test -n "$AWK_VERSION_OUTPUT"; then
7272- # It's GNU awk, which supports PROCINFO.
7373- AWK_OPTION=--non-decimal-data
7474- fi
7575-7676- cat <<'EOF' >conftest.$ac_ext
7777- #include <pthread.h>
7878- pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
7979- EOF
8080-8181- if $CC -c conftest.$ac_ext; then :
8282- ac_mtx_size=$($OBJDUMP -j .bss -t conftest.$ac_objext \
8383- | $AWK $AWK_OPTION '
8484- /mtx$/ { mtx_size = int("0x" $5) }
8585- END { print mtx_size }')
8686- else
8787- echo "Can't determine mutex size"
8888- exit 1
8989- fi
9090- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9191-9292- cat <<EOF
9393- ## lock-obj-pub.$host.h
9494- ## File created by gen-lock-obj.sh - DO NOT EDIT
9595- ## To be included by mkheader into gpg-error.h
9696-9797- typedef struct
9898- {
9999- long _vers;
100100- union {
101101- volatile char _priv[$ac_mtx_size];
102102- long _x_align;
103103- long *_xp_align;
104104- } u;
105105- } gpgrt_lock_t;
106106-107107- EOF
108108-109109- # FIXME: Support different alignment conditions of:
110110- #
111111- # USE_16BYTE_ALIGNMENT
112112- # USE_DOUBLE_FOR_ALIGNMENT
113113- # USE_LONG_DOUBLE_FOR_ALIGNMENT
114114- #
115115-116116- echo ${ECHO_N} "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{${ECHO_C}"
117117-118118- i=0
119119- while test "$i" -lt $ac_mtx_size; do
120120- if test "$i" -ne 0 -a "$(( $i % 8 ))" -eq 0; then
121121- echo ' \'
122122- echo ${ECHO_N} " ${ECHO_C}"
123123- fi
124124- echo ${ECHO_N} "0${ECHO_C}"
125125- if test "$i" -lt $(($ac_mtx_size - 1)); then
126126- echo ${ECHO_N} ",${ECHO_C}"
127127- fi
128128- i=$(( i + 1 ))
129129- done
130130- fi
131131-132132- cat <<'EOF'
133133- }}}
134134- ##
135135- ## Local Variables:
136136- ## mode: c
137137- ## buffer-read-only: t
138138- ## End:
139139- ##
140140- EOF
141141-142142- exit 0
···11-From 5c44459c3b28a9bd3283aaceab7c615f8020c531 Mon Sep 17 00:00:00 2001
22-From: Mark Adler <madler@alumni.caltech.edu>
33-Date: Tue, 17 Apr 2018 22:09:22 -0700
44-Subject: [PATCH 1/2] Fix a bug that can crash deflate on some input when using
55- Z_FIXED.
66-77-This bug was reported by Danilo Ramos of Eideticom, Inc. It has
88-lain in wait 13 years before being found! The bug was introduced
99-in zlib 1.2.2.2, with the addition of the Z_FIXED option. That
1010-option forces the use of fixed Huffman codes. For rare inputs with
1111-a large number of distant matches, the pending buffer into which
1212-the compressed data is written can overwrite the distance symbol
1313-table which it overlays. That results in corrupted output due to
1414-invalid distances, and can result in out-of-bound accesses,
1515-crashing the application.
1616-1717-The fix here combines the distance buffer and literal/length
1818-buffers into a single symbol buffer. Now three bytes of pending
1919-buffer space are opened up for each literal or length/distance
2020-pair consumed, instead of the previous two bytes. This assures
2121-that the pending buffer cannot overwrite the symbol table, since
2222-the maximum fixed code compressed length/distance is 31 bits, and
2323-since there are four bytes of pending space for every three bytes
2424-of symbol space.
2525----
2626- deflate.c | 74 ++++++++++++++++++++++++++++++++++++++++---------------
2727- deflate.h | 25 +++++++++----------
2828- trees.c | 50 +++++++++++--------------------------
2929- 3 files changed, 79 insertions(+), 70 deletions(-)
3030-3131-diff --git a/deflate.c b/deflate.c
3232-index 425babc..19cba87 100644
3333---- a/deflate.c
3434-+++ b/deflate.c
3535-@@ -255,11 +255,6 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
3636- int wrap = 1;
3737- static const char my_version[] = ZLIB_VERSION;
3838-3939-- ushf *overlay;
4040-- /* We overlay pending_buf and d_buf+l_buf. This works since the average
4141-- * output size for (length,distance) codes is <= 24 bits.
4242-- */
4343--
4444- if (version == Z_NULL || version[0] != my_version[0] ||
4545- stream_size != sizeof(z_stream)) {
4646- return Z_VERSION_ERROR;
4747-@@ -329,9 +324,47 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
4848-4949- s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
5050-5151-- overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
5252-- s->pending_buf = (uchf *) overlay;
5353-- s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
5454-+ /* We overlay pending_buf and sym_buf. This works since the average size
5555-+ * for length/distance pairs over any compressed block is assured to be 31
5656-+ * bits or less.
5757-+ *
5858-+ * Analysis: The longest fixed codes are a length code of 8 bits plus 5
5959-+ * extra bits, for lengths 131 to 257. The longest fixed distance codes are
6060-+ * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest
6161-+ * possible fixed-codes length/distance pair is then 31 bits total.
6262-+ *
6363-+ * sym_buf starts one-fourth of the way into pending_buf. So there are
6464-+ * three bytes in sym_buf for every four bytes in pending_buf. Each symbol
6565-+ * in sym_buf is three bytes -- two for the distance and one for the
6666-+ * literal/length. As each symbol is consumed, the pointer to the next
6767-+ * sym_buf value to read moves forward three bytes. From that symbol, up to
6868-+ * 31 bits are written to pending_buf. The closest the written pending_buf
6969-+ * bits gets to the next sym_buf symbol to read is just before the last
7070-+ * code is written. At that time, 31*(n-2) bits have been written, just
7171-+ * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at
7272-+ * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1
7373-+ * symbols are written.) The closest the writing gets to what is unread is
7474-+ * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and
7575-+ * can range from 128 to 32768.
7676-+ *
7777-+ * Therefore, at a minimum, there are 142 bits of space between what is
7878-+ * written and what is read in the overlain buffers, so the symbols cannot
7979-+ * be overwritten by the compressed data. That space is actually 139 bits,
8080-+ * due to the three-bit fixed-code block header.
8181-+ *
8282-+ * That covers the case where either Z_FIXED is specified, forcing fixed
8383-+ * codes, or when the use of fixed codes is chosen, because that choice
8484-+ * results in a smaller compressed block than dynamic codes. That latter
8585-+ * condition then assures that the above analysis also covers all dynamic
8686-+ * blocks. A dynamic-code block will only be chosen to be emitted if it has
8787-+ * fewer bits than a fixed-code block would for the same set of symbols.
8888-+ * Therefore its average symbol length is assured to be less than 31. So
8989-+ * the compressed data for a dynamic block also cannot overwrite the
9090-+ * symbols from which it is being constructed.
9191-+ */
9292-+
9393-+ s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4);
9494-+ s->pending_buf_size = (ulg)s->lit_bufsize * 4;
9595-9696- if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
9797- s->pending_buf == Z_NULL) {
9898-@@ -340,8 +373,12 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
9999- deflateEnd (strm);
100100- return Z_MEM_ERROR;
101101- }
102102-- s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
103103-- s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
104104-+ s->sym_buf = s->pending_buf + s->lit_bufsize;
105105-+ s->sym_end = (s->lit_bufsize - 1) * 3;
106106-+ /* We avoid equality with lit_bufsize*3 because of wraparound at 64K
107107-+ * on 16 bit machines and because stored blocks are restricted to
108108-+ * 64K-1 bytes.
109109-+ */
110110-111111- s->level = level;
112112- s->strategy = strategy;
113113-@@ -552,7 +589,7 @@ int ZEXPORT deflatePrime (strm, bits, value)
114114-115115- if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
116116- s = strm->state;
117117-- if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
118118-+ if (s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
119119- return Z_BUF_ERROR;
120120- do {
121121- put = Buf_size - s->bi_valid;
122122-@@ -1113,7 +1150,6 @@ int ZEXPORT deflateCopy (dest, source)
123123- #else
124124- deflate_state *ds;
125125- deflate_state *ss;
126126-- ushf *overlay;
127127-128128-129129- if (deflateStateCheck(source) || dest == Z_NULL) {
130130-@@ -1133,8 +1169,7 @@ int ZEXPORT deflateCopy (dest, source)
131131- ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
132132- ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
133133- ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
134134-- overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
135135-- ds->pending_buf = (uchf *) overlay;
136136-+ ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4);
137137-138138- if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
139139- ds->pending_buf == Z_NULL) {
140140-@@ -1148,8 +1183,7 @@ int ZEXPORT deflateCopy (dest, source)
141141- zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
142142-143143- ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
144144-- ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
145145-- ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
146146-+ ds->sym_buf = ds->pending_buf + ds->lit_bufsize;
147147-148148- ds->l_desc.dyn_tree = ds->dyn_ltree;
149149- ds->d_desc.dyn_tree = ds->dyn_dtree;
150150-@@ -1925,7 +1959,7 @@ local block_state deflate_fast(s, flush)
151151- FLUSH_BLOCK(s, 1);
152152- return finish_done;
153153- }
154154-- if (s->last_lit)
155155-+ if (s->sym_next)
156156- FLUSH_BLOCK(s, 0);
157157- return block_done;
158158- }
159159-@@ -2056,7 +2090,7 @@ local block_state deflate_slow(s, flush)
160160- FLUSH_BLOCK(s, 1);
161161- return finish_done;
162162- }
163163-- if (s->last_lit)
164164-+ if (s->sym_next)
165165- FLUSH_BLOCK(s, 0);
166166- return block_done;
167167- }
168168-@@ -2131,7 +2165,7 @@ local block_state deflate_rle(s, flush)
169169- FLUSH_BLOCK(s, 1);
170170- return finish_done;
171171- }
172172-- if (s->last_lit)
173173-+ if (s->sym_next)
174174- FLUSH_BLOCK(s, 0);
175175- return block_done;
176176- }
177177-@@ -2170,7 +2204,7 @@ local block_state deflate_huff(s, flush)
178178- FLUSH_BLOCK(s, 1);
179179- return finish_done;
180180- }
181181-- if (s->last_lit)
182182-+ if (s->sym_next)
183183- FLUSH_BLOCK(s, 0);
184184- return block_done;
185185- }
186186-diff --git a/deflate.h b/deflate.h
187187-index 23ecdd3..d4cf1a9 100644
188188---- a/deflate.h
189189-+++ b/deflate.h
190190-@@ -217,7 +217,7 @@ typedef struct internal_state {
191191- /* Depth of each subtree used as tie breaker for trees of equal frequency
192192- */
193193-194194-- uchf *l_buf; /* buffer for literals or lengths */
195195-+ uchf *sym_buf; /* buffer for distances and literals/lengths */
196196-197197- uInt lit_bufsize;
198198- /* Size of match buffer for literals/lengths. There are 4 reasons for
199199-@@ -239,13 +239,8 @@ typedef struct internal_state {
200200- * - I can't count above 4
201201- */
202202-203203-- uInt last_lit; /* running index in l_buf */
204204--
205205-- ushf *d_buf;
206206-- /* Buffer for distances. To simplify the code, d_buf and l_buf have
207207-- * the same number of elements. To use different lengths, an extra flag
208208-- * array would be necessary.
209209-- */
210210-+ uInt sym_next; /* running index in sym_buf */
211211-+ uInt sym_end; /* symbol table full when sym_next reaches this */
212212-213213- ulg opt_len; /* bit length of current block with optimal trees */
214214- ulg static_len; /* bit length of current block with static trees */
215215-@@ -325,20 +320,22 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
216216-217217- # define _tr_tally_lit(s, c, flush) \
218218- { uch cc = (c); \
219219-- s->d_buf[s->last_lit] = 0; \
220220-- s->l_buf[s->last_lit++] = cc; \
221221-+ s->sym_buf[s->sym_next++] = 0; \
222222-+ s->sym_buf[s->sym_next++] = 0; \
223223-+ s->sym_buf[s->sym_next++] = cc; \
224224- s->dyn_ltree[cc].Freq++; \
225225-- flush = (s->last_lit == s->lit_bufsize-1); \
226226-+ flush = (s->sym_next == s->sym_end); \
227227- }
228228- # define _tr_tally_dist(s, distance, length, flush) \
229229- { uch len = (uch)(length); \
230230- ush dist = (ush)(distance); \
231231-- s->d_buf[s->last_lit] = dist; \
232232-- s->l_buf[s->last_lit++] = len; \
233233-+ s->sym_buf[s->sym_next++] = dist; \
234234-+ s->sym_buf[s->sym_next++] = dist >> 8; \
235235-+ s->sym_buf[s->sym_next++] = len; \
236236- dist--; \
237237- s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
238238- s->dyn_dtree[d_code(dist)].Freq++; \
239239-- flush = (s->last_lit == s->lit_bufsize-1); \
240240-+ flush = (s->sym_next == s->sym_end); \
241241- }
242242- #else
243243- # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
244244-diff --git a/trees.c b/trees.c
245245-index 4f4a650..decaeb7 100644
246246---- a/trees.c
247247-+++ b/trees.c
248248-@@ -416,7 +416,7 @@ local void init_block(s)
249249-250250- s->dyn_ltree[END_BLOCK].Freq = 1;
251251- s->opt_len = s->static_len = 0L;
252252-- s->last_lit = s->matches = 0;
253253-+ s->sym_next = s->matches = 0;
254254- }
255255-256256- #define SMALLEST 1
257257-@@ -948,7 +948,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
258258-259259- Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
260260- opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
261261-- s->last_lit));
262262-+ s->sym_next / 3));
263263-264264- if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
265265-266266-@@ -1017,8 +1017,9 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
267267- unsigned dist; /* distance of matched string */
268268- unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
269269- {
270270-- s->d_buf[s->last_lit] = (ush)dist;
271271-- s->l_buf[s->last_lit++] = (uch)lc;
272272-+ s->sym_buf[s->sym_next++] = dist;
273273-+ s->sym_buf[s->sym_next++] = dist >> 8;
274274-+ s->sym_buf[s->sym_next++] = lc;
275275- if (dist == 0) {
276276- /* lc is the unmatched char */
277277- s->dyn_ltree[lc].Freq++;
278278-@@ -1033,30 +1034,7 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
279279- s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
280280- s->dyn_dtree[d_code(dist)].Freq++;
281281- }
282282--
283283--#ifdef TRUNCATE_BLOCK
284284-- /* Try to guess if it is profitable to stop the current block here */
285285-- if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
286286-- /* Compute an upper bound for the compressed length */
287287-- ulg out_length = (ulg)s->last_lit*8L;
288288-- ulg in_length = (ulg)((long)s->strstart - s->block_start);
289289-- int dcode;
290290-- for (dcode = 0; dcode < D_CODES; dcode++) {
291291-- out_length += (ulg)s->dyn_dtree[dcode].Freq *
292292-- (5L+extra_dbits[dcode]);
293293-- }
294294-- out_length >>= 3;
295295-- Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
296296-- s->last_lit, in_length, out_length,
297297-- 100L - out_length*100L/in_length));
298298-- if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
299299-- }
300300--#endif
301301-- return (s->last_lit == s->lit_bufsize-1);
302302-- /* We avoid equality with lit_bufsize because of wraparound at 64K
303303-- * on 16 bit machines and because stored blocks are restricted to
304304-- * 64K-1 bytes.
305305-- */
306306-+ return (s->sym_next == s->sym_end);
307307- }
308308-309309- /* ===========================================================================
310310-@@ -1069,13 +1047,14 @@ local void compress_block(s, ltree, dtree)
311311- {
312312- unsigned dist; /* distance of matched string */
313313- int lc; /* match length or unmatched char (if dist == 0) */
314314-- unsigned lx = 0; /* running index in l_buf */
315315-+ unsigned sx = 0; /* running index in sym_buf */
316316- unsigned code; /* the code to send */
317317- int extra; /* number of extra bits to send */
318318-319319-- if (s->last_lit != 0) do {
320320-- dist = s->d_buf[lx];
321321-- lc = s->l_buf[lx++];
322322-+ if (s->sym_next != 0) do {
323323-+ dist = s->sym_buf[sx++] & 0xff;
324324-+ dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
325325-+ lc = s->sym_buf[sx++];
326326- if (dist == 0) {
327327- send_code(s, lc, ltree); /* send a literal byte */
328328- Tracecv(isgraph(lc), (stderr," '%c' ", lc));
329329-@@ -1100,11 +1079,10 @@ local void compress_block(s, ltree, dtree)
330330- }
331331- } /* literal or match pair ? */
332332-333333-- /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
334334-- Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
335335-- "pendingBuf overflow");
336336-+ /* Check that the overlay between pending_buf and sym_buf is ok: */
337337-+ Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
338338-339339-- } while (lx < s->last_lit);
340340-+ } while (sx < s->sym_next);
341341-342342- send_code(s, END_BLOCK, ltree);
343343- }
344344---
345345-2.33.1
346346-
···99, regex
1010, tabview
1111, python
1212+, unittestCheckHook
1213}:
13141415buildPythonPackage rec {
···3334 tabview
3435 ];
35363737+ checkInputs = [ unittestCheckHook ];
3838+3639 pythonImportsCheck = [
3740 "clevercsv"
3841 "clevercsv.cparser"
3942 ];
40434141- checkPhase = ''
4444+ preCheck = ''
4245 # by linking the installed version the tests also have access to compiled native libraries
4346 rm -r clevercsv
4447 ln -s $out/${python.sitePackages}/clevercsv/ clevercsv
4545- # their ci only runs unit tests, there are also integration and fuzzing tests
4646- ${python.interpreter} -m unittest discover -v -f -s ./tests/test_unit
4748 '';
4949+5050+ # their ci only runs unit tests, there are also integration and fuzzing tests
5151+ unittestFlagsArray = [ "-v" "-f" "-s" "./tests/test_unit" ];
48524953 meta = with lib; {
5054 description = "CleverCSV is a Python package for handling messy CSV files";
5155 longDescription = ''
5252- CleverCSV is a Python package for handling messy CSV files. It provides
5353- a drop-in replacement for the builtin CSV module with improved dialect
5454- detection, and comes with a handy command line application for working
5555- with CSV files.
5656+ CleverCSV is a Python package for handling messy CSV files. It provides
5757+ a drop-in replacement for the builtin CSV module with improved dialect
5858+ detection, and comes with a handy command line application for working
5959+ with CSV files.
5660 '';
5761 homepage = "https://github.com/alan-turing-institute/CleverCSV";
5862 changelog = "https://github.com/alan-turing-institute/CleverCSV/blob/master/CHANGELOG.md";
···11---- a/mesonbuild/coredata.py
22-+++ b/mesonbuild/coredata.py
33-@@ -506,7 +506,6 @@ class CoreData:
44- return value
55- if option.name.endswith('dir') and value.is_absolute() and \
66- option not in BULITIN_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-@@ -518,7 +517,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()
···10101111python3.pkgs.buildPythonApplication rec {
1212 pname = "meson";
1313- version = "0.61.2";
1313+ version = "0.63.1";
14141515 src = python3.pkgs.fetchPypi {
1616 inherit pname version;
1717- hash = "sha256-AjOn+NlZB5MY9gUrCTnCf2il3oa6YB8lye5oaftfWIk=";
1717+ sha256 = "Bv4TKXIT1v8BIcXVqrJaVu+Tj/7FdBTtYIb9onLLZek=";
1818 };
19192020 patches = [
2121- # Upstream insists on not allowing bindir and other dir options
2222- # outside of prefix for some reason:
2323- # https://github.com/mesonbuild/meson/issues/2561
2424- # We remove the check so multiple outputs can work sanely.
2525- ./allow-dirs-outside-of-prefix.patch
2626-2721 # Meson is currently inspecting fewer variables than autoconf does, which
2822 # makes it harder for us to use setup hooks, etc. Taken from
2923 # https://github.com/mesonbuild/meson/pull/6827
3024 ./more-env-vars.patch
3131-3232- # Use more binutils variables, so we don't have to define them in stdenv.
3333- # pr has been merged
3434- # https://github.com/mesonbuild/meson/pull/10640
3535- (fetchpatch {
3636- url = "https://github.com/mesonbuild/meson/commit/8a8ab9a8e0c2cefb6faa0734e52803c74790576c.patch";
3737- sha256 = "sha256-BdBf1NB4SZLFyFRDzD0p//XUgUeAHpo6XXUtsHdCgKE=";
3838- })
39254026 # Unlike libtool, vanilla Meson does not pass any information
4127 # about the path library will be installed to to g-ir-scanner,
···6753 # https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774
6854 ./boost-Do-not-add-system-paths-on-nix.patch
69557070- # https://github.com/mesonbuild/meson/pull/9841
7171- # cross-compilation fix
5656+ # Prevent Meson from passing -O0 in buildtype=plain.
5757+ # Nixpkgs enables fortifications which do not work without optimizations.
5858+ # https://github.com/mesonbuild/meson/pull/10593
7259 (fetchpatch {
7373- url = "https://github.com/mesonbuild/meson/commit/266e8acb5807b38a550cb5145cea0e19545a21d7.patch";
7474- sha256 = "sha256-1GdKsm2xvq2GxTNeTyBH5O73hxboL0YI+w2BCoUeWXM=";
6060+ url = "https://github.com/mesonbuild/meson/commit/f9bfeb2add70973113ab4a98454a5c5d7e3a26ae.patch";
6161+ revert = true;
6262+ sha256 = "VKXUwdS+zMp1y+5GrV2inESUpUUp+OL3aI4wOXHxOeo=";
6363+ })
6464+6565+ # Fix passing multiple --define-variable arguments to pkg-config.
6666+ # https://github.com/mesonbuild/meson/pull/10670
6767+ (fetchpatch {
6868+ url = "https://github.com/mesonbuild/meson/commit/d5252c5d4cf1c1931fef0c1c98dd66c000891d21.patch";
6969+ sha256 = "GiUNVul1N5Fl8mfqM7vA/r1FdKqImiDYLXMVDt77gvw=";
7070+ excludes = [
7171+ "docs/yaml/objects/dep.yaml"
7272+ ];
7573 })
7676- ] ++ lib.optionals withDarwinFrameworksGtkDocPatch [
7777- # Fix building gtkdoc for GLib
7878- # https://github.com/mesonbuild/meson/pull/10186
7979- ./fix-gtkdoc-when-using-multiple-apple-frameworks.patch
8074 ];
81758276 setupHook = ./setup-hook.sh;
···2222in
2323stdenv.mkDerivation rec {
2424 pname = "vulkan-validation-layers";
2525- version = "1.3.211.0";
2525+ version = "1.3.216.0";
26262727 # If we were to use "dev" here instead of headers, the setupHook would be
2828 # placed in that output instead of "out".
···3434 owner = "KhronosGroup";
3535 repo = "Vulkan-ValidationLayers";
3636 rev = "sdk-${version}";
3737- sha256 = "sha256-NGpFfekZtB0rvnGxYVDo808xzgBuo8ZC4bjXjQnTpxU=";
3737+ hash = "sha256-ri6ImAuskbvYL/ZM8kaVDZRP2v1qfSaafVacwwRF424=";
3838 });
39394040 # Include absolute paths to layer libraries in their associated
+23-7
pkgs/development/tools/xcbuild/wrapper.nix
···11-{ stdenv, makeWrapper, writeText, runCommand
11+{ lib, stdenv, makeWrapper, writeText, writeShellScriptBin, runCommand
22, CoreServices, ImageIO, CoreGraphics
33, runtimeShell, callPackage
44, xcodePlatform ? stdenv.targetPlatform.xcodePlatform or "MacOSX"
···991010 toolchainName = "com.apple.dt.toolchain.XcodeDefault";
1111 sdkName = "${xcodePlatform}${sdkVer}";
1212+ xcrunSdkName = lib.toLower xcodePlatform;
12131314 # TODO: expose MACOSX_DEPLOYMENT_TARGET in nix so we can use it here.
1415 sdkBuildVersion = "17E189";
···5051done
5152 '';
52535353- xcrun = writeText "xcrun" ''
5454-#!${runtimeShell}
5454+ xcrun = writeShellScriptBin "xcrun" ''
5555+args=( "$@" )
5656+5757+# If an SDK was requested, check that it matches.
5858+for ((i = 0; i < ''${#args[@]}; i++)); do
5959+ case "''${args[i]}" in
6060+ --sdk | -sdk)
6161+ i=$((i + 1))
6262+ if [[ "''${args[i]}" != '${xcrunSdkName}' ]]; then
6363+ echo >&2 "xcodebuild: error: SDK \"''${args[i]}\" cannot be located."
6464+ exit 1
6565+ fi
6666+ ;;
6767+ esac
6868+done
6969+5570while [ $# -gt 0 ]; do
5671 case "$1" in
5772 --sdk | -sdk) shift ;;
5858- --find | -find)
7373+ --toolchain | -toolchain) shift ;;
7474+ --find | -find | -f)
5975 shift
6076 command -v $1 ;;
6177 --log | -log) ;; # noop
···7490 esac
7591 shift
7692done
9393+7794if ! [[ -z "$@" ]]; then
7895 exec "$@"
7996fi
···89106 propagatedBuildInputs = [ "${toolchains}/XcodeDefault.xctoolchain" ];
9010791108 passthru = {
9292- inherit xcbuild;
109109+ inherit xcbuild xcrun;
93110 toolchain = "${toolchains}/XcodeDefault.xctoolchain";
94111 sdk = "${sdks}/${sdkName}";
95112 platform = "${platforms}/${xcodePlatform}.platform";
···126143 --subst-var-by DEVELOPER_DIR $out/Applications/Xcode.app/Contents/Developer
127144 chmod +x $out/bin/xcode-select
128145129129- substitute ${xcrun} $out/bin/xcrun
130130- chmod +x $out/bin/xcrun
146146+ cp ${xcrun}/bin/xcrun $out/bin/xcrun
131147132148 for bin in PlistBuddy actool builtin-copy builtin-copyPlist \
133149 builtin-copyStrings builtin-copyTiff \
···2323stdenv.mkDerivation rec {
2424 pname = "vulkan-tools-lunarg";
2525 # The version must match that in vulkan-headers
2626- version = "1.3.211.0";
2626+ version = "1.3.216.0";
27272828 src = (assert version == vulkan-headers.version;
2929 fetchFromGitHub {
3030 owner = "LunarG";
3131 repo = "VulkanTools";
3232 rev = "sdk-${version}";
3333- sha256 = "sha256-Pkz2FV0AnTKm/4jVmkQNkYzpxpKJaSoy2fRAhVh5OKU=";
3333+ hash = "sha256-NhYQSL5iU7iSO5Q6lp1iwhbi5GEfD11MDmBn9Uk1jm0=";
3434 fetchSubmodules = true;
3535 });
3636
+2-2
pkgs/tools/graphics/vulkan-tools/default.nix
···21212222stdenv.mkDerivation rec {
2323 pname = "vulkan-tools";
2424- version = "1.3.211.0";
2424+ version = "1.3.216.0";
25252626 # It's not strictly necessary to have matching versions here, however
2727 # since we're using the SDK version we may as well be consistent with
···3131 owner = "KhronosGroup";
3232 repo = "Vulkan-Tools";
3333 rev = "sdk-${version}";
3434- sha256 = "sha256-iXsWTKNllPZy1Kpo3JHzEEus3Hu9LofvMB3c4Gn6/DM=";
3434+ hash = "sha256-VEMeURNboiOwPGrtFGUt9ZyChj8pV0xcpydrarcwtF0=";
3535 });
36363737 nativeBuildInputs = [
+2-2
pkgs/tools/misc/man-db/default.nix
···22, db
33, fetchurl
44, groff
55+, gzip
56, lib
67, libiconv
78, libpipeline
···6869 # make sure that we don't wrap symlinks (since that changes argv[0] to the -wrapped name)
6970 find "$out/bin" -type f | while read file; do
7071 wrapProgram "$file" \
7171- --prefix PATH : "${lib.getBin groff}/bin" \
7272- --prefix PATH : "${lib.getBin zstd}/bin"
7272+ --prefix PATH : "${lib.makeBinPath [ groff gzip zstd ]}"
7373 done
7474 '';
7575