Merge branch 'staging' into staging-next

This commit is contained in:
Vladimír Čunát
2022-08-16 13:12:47 +02:00
228 changed files with 1287 additions and 2293 deletions
@@ -734,6 +734,16 @@ work in any of the formats supported by `buildPythonPackage` currently,
with the exception of `other` (see `format` in
[`buildPythonPackage` parameters](#buildpythonpackage-parameters) for more details).
### Using unittestCheckHook {#using-unittestcheckhook}
`unittestCheckHook` is a hook which will substitute the setuptools `test` command for a `checkPhase` which runs `python -m unittest discover`:
```
checkInputs = [ unittestCheckHook ];
unittestFlags = [ "-s" "tests" "-v" ];
```
### Develop local package {#develop-local-package}
As a Python developer you're likely aware of [development mode](http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode)
@@ -1270,6 +1280,7 @@ are used in `buildPythonPackage`.
with the `pipInstallHook`.
- `pythonRelaxDepsHook` will relax Python dependencies restrictions for the package.
See [example usage](#using-pythonrelaxdepshook).
- `unittestCheckHook` will run tests with `python -m unittest discover`. See [example usage](#using-unittestcheckhook).
### Development mode {#development-mode}
+7 -1
View File
@@ -65,11 +65,17 @@ rec {
# is why we use the more obscure "bfd" and not "binutils" for this
# choice.
else "bfd";
extensions = {
extensions = rec {
sharedLibrary =
/**/ if final.isDarwin then ".dylib"
else if final.isWindows then ".dll"
else ".so";
staticLibrary =
/**/ if final.isWindows then ".lib"
else ".a";
library =
/**/ if final.isStatic then staticLibrary
else sharedLibrary;
executable =
/**/ if final.isWindows then ".exe"
else "";
+3 -4
View File
@@ -37,6 +37,7 @@ in python3.pkgs.buildPythonApplication rec {
nativeBuildInputs = with python3.pkgs; [
setuptools-scm
docutils
setuptoolsCheckHook
];
propagatedBuildInputs = with python3.pkgs; [
@@ -64,14 +65,12 @@ in python3.pkgs.buildPythonApplication rec {
export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
'';
checkPhase = ''
runHook preCheck
preCheck = ''
# disable tests that require internet access
# https://github.com/JoeLametta/whipper/issues/291
substituteInPlace whipper/test/test_common_accurip.py \
--replace "test_AccurateRipResponse" "dont_test_AccurateRipResponse"
HOME=$TMPDIR ${python3.interpreter} -m unittest discover
runHook postCheck
export HOME=$TMPDIR
'';
passthru.tests.version = testers.testVersion {
+3 -3
View File
@@ -1,12 +1,12 @@
{ lib, fetchFromGitHub }:
rec {
version = "9.0.0135";
version = "9.0.0180";
src = fetchFromGitHub {
owner = "vim";
repo = "vim";
rev = "v${version}";
sha256 = "sha256-xAIfGNJIPO9XoSbAQTRa36Tjln3y+oWQk0lADCnL25g=";
hash = "sha256-38l97auTi6cue457bfRHme5fvsAmvk1MT2va1E/qguw=";
};
enableParallelBuilding = true;
@@ -24,7 +24,7 @@ rec {
description = "The most popular clone of the VI editor";
homepage = "http://www.vim.org";
license = licenses.vim;
maintainers = with maintainers; [ lovek323 equirosa ];
maintainers = with maintainers; [ das_j equirosa ];
platforms = platforms.unix;
};
}
@@ -52,11 +52,9 @@ buildPythonApplication rec {
# will fail without pre-seeded config files
doCheck = false;
checkInputs = [ mock ];
checkInputs = [ unittestCheckHook mock ];
checkPhase = ''
${python.interpreter} -m unittest discover -s tests -v
'';
unittestFlagsArray = [ "-s" "tests" "-v" ];
meta = with lib; {
homepage = "https://github.com/donnemartin/haxor-news";
+1 -3
View File
@@ -15,9 +15,7 @@ in buildPythonApplication rec {
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [ pyyaml six jinja2 cerberus_1_1 ];
checkPhase = ''
${python.interpreter} -m unittest discover
'';
checkInputs = [ unittestCheckHook ];
meta = with lib; {
homepage = "https://pythonhosted.org/pyditz/";
+4 -5
View File
@@ -1,4 +1,4 @@
{ lib, python3Packages, fetchFromGitHub, glibcLocales }:
{ lib, python3Packages, fetchFromGitHub, glibcLocales, unittestCheckHook }:
with python3Packages;
@@ -22,16 +22,15 @@ buildPythonApplication rec {
watchdog
];
checkInputs = [ mock freezegun pylint ];
checkInputs = [ unittestCheckHook mock freezegun pylint ];
# Skip test that has been reported multiple times upstream without result:
# bram85/topydo#271, bram85/topydo#274.
checkPhase = ''
preCheck = ''
substituteInPlace test/test_revert_command.py --replace 'test_revert_ls' 'dont_test_revert_ls'
python -m unittest discover
'';
LC_ALL="en_US.UTF-8";
LC_ALL = "en_US.UTF-8";
meta = with lib; {
description = "A cli todo application compatible with the todo.txt format";
@@ -531,7 +531,6 @@ buildStdenv.mkDerivation ({
header "separating debug info from $i (build ID $id)"
mkdir -p "$dst/''${id:0:2}"
$OBJCOPY --only-keep-debug "$i" "$dst/''${id:0:2}/''${id:2}.debug"
$STRIP --strip-debug "$i"
# Also a create a symlink <original-name>.debug.
ln -sfn ".build-id/''${id:0:2}/''${id:2}.debug" "$dst/../$(basename "$i")"
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchgit, wrapGAppsHook, autoreconfHook, bison, flex
{ stdenv, lib, fetchgit, fetchurl, wrapGAppsHook, autoreconfHook, bison, flex
, curl, gtk3, pkg-config, python3, shared-mime-info
, glib-networking, gsettings-desktop-schemas
@@ -110,6 +110,11 @@ in stdenv.mkDerivation rec {
patches = [
./mime.patch
# fix build with perl 5.36+
(fetchurl {
url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/claws-mail/trunk/20cope_with_fix_for_1009149.patch";
hash = "sha256-/WBslmoFvja2v2GEBntxvNtG0I3xtkUUqXO5gl5pqqs=";
})
];
preConfigure = ''
@@ -28,7 +28,7 @@ assert sendEmailSupport -> perlSupport;
assert svnSupport -> perlSupport;
let
version = "2.37.1";
version = "2.37.2";
svn = subversionClient.override { perlBindings = perlSupport; };
gitwebPerlLibs = with perlPackages; [ CGI HTMLParser CGIFast FCGI FCGIProcManager HTMLTagCloud ];
in
@@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: {
src = fetchurl {
url = "https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz";
sha256 = "sha256-yBYsa4uPHF23BqsBtO4p4xBhGCE13CfEhgIkquwbNQA=";
sha256 = "sha256-HD2cghxFOOem2sMKSvi9jc/k9lH5VHTFJrUvg0BtsAM=";
};
outputs = [ "out" ] ++ lib.optional withManual "doc";
@@ -15,7 +15,7 @@
, udev
, pixman
, libinput
, libseat
, seatd
, xwayland
, glslang
, stb
@@ -65,7 +65,7 @@ stdenv.mkDerivation {
wayland-protocols
wlroots
xwayland
libseat
seatd
libinput
libxkbcommon
udev
@@ -365,7 +365,7 @@ stdenv.mkDerivation {
##
+ extraBuildCommands;
inherit dynamicLinker expand-response-params;
inherit dynamicLinker;
# for substitution in utils.bash
expandResponseParams = "${expand-response-params}/bin/expand-response-params";
+2 -1
View File
@@ -157,6 +157,8 @@ stdenv.mkDerivation {
'(${concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)}))
'';
inherit expand-response-params;
inherit nixSupport;
};
@@ -540,7 +542,6 @@ stdenv.mkDerivation {
(name: value: "echo ${toString value} >> $out/nix-support/${name}")
nixSupport);
inherit expand-response-params;
# for substitution in utils.bash
expandResponseParams = "${expand-response-params}/bin/expand-response-params";
+1 -4
View File
@@ -75,11 +75,8 @@ in {
${lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
[target."${shortTarget}"]
"linker" = "${ccForHost}"
${# https://github.com/rust-lang/rust/issues/46651#issuecomment-433611633
lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isAarch64) ''
"rustflags" = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ]
''}
''}
"rustflags" = [ "-C", "target-feature=${if stdenv.hostPlatform.isStatic then "+" else "-"}crt-static" ]
'';
};
} ./cargo-setup-hook.sh) {};
@@ -2,7 +2,6 @@ export NIX_SET_BUILD_ID=1
export NIX_LDFLAGS+=" --compress-debug-sections=zlib"
export NIX_CFLAGS_COMPILE+=" -ggdb -Wa,--compress-debug-sections"
export RUSTFLAGS+=" -g"
dontStrip=1
fixupOutputHooks+=(_separateDebugInfo)
@@ -35,7 +34,6 @@ _separateDebugInfo() {
# firmware blobs in QEMU.)
(
$OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
$STRIP --strip-debug "$i"
# Also a create a symlink <original-name>.debug.
ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
+12 -11
View File
@@ -38,26 +38,27 @@ _doStrip() {
stripDirs() {
local cmd="$1"
local ranlibCmd="$2"
local dirs="$3"
local paths="$3"
local stripFlags="$4"
local dirsNew=
local pathsNew=
local d
for d in ${dirs}; do
if [ -d "$prefix/$d" ]; then
dirsNew="${dirsNew} $prefix/$d "
local p
for p in ${paths}; do
if [ -e "$prefix/$p" ]; then
pathsNew="${pathsNew} $prefix/$p"
fi
done
dirs=${dirsNew}
paths=${pathsNew}
if [ -n "${dirs}" ]; then
echo "stripping (with command $cmd and flags $stripFlags) in$dirs"
find $dirs -type f -exec $cmd $stripFlags '{}' \; 2>/dev/null
if [ -n "${paths}" ]; then
echo "stripping (with command $cmd and flags $stripFlags) in $paths"
# Do not strip lib/debug. This is a directory used by setup-hooks/separate-debug-info.sh.
find $paths -type f -a '!' -wholename "$prefix/lib/debug/*" -exec $cmd $stripFlags '{}' \; 2>/dev/null
# 'strip' does not normally preserve archive index in .a files.
# This usually causes linking failures against static libs like:
# ld: ...-i686-w64-mingw32-stage-final-gcc-13.0.0-lib/i686-w64-mingw32/lib/libstdc++.dll.a:
# error adding symbols: archive has no index; run ranlib to add one
# Restore the index by running 'ranlib'.
find $dirs -name '*.a' -type f -exec $ranlibCmd '{}' \; 2>/dev/null
find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2>/dev/null
fi
}
+11 -11
View File
@@ -2,18 +2,18 @@
stdenv.mkDerivation rec {
pname = "tzdata";
version = "2022a";
version = "2022b";
srcs =
[ (fetchurl {
url = "https://data.iana.org/time-zones/releases/tzdata${version}.tar.gz";
sha256 = "0r0nhwpk9nyxj5kkvjy58nr5d85568m04dcb69c4y3zmykczyzzg";
})
(fetchurl {
url = "https://data.iana.org/time-zones/releases/tzcode${version}.tar.gz";
sha256 = "1iysv8fdkm79k8wh8jizmjmq075q4qjhk090vxjy57my6dz5wmzq";
})
];
srcs = [
(fetchurl {
url = "https://data.iana.org/time-zones/releases/tzdata${version}.tar.gz";
hash = "sha256-9ZDq8Eo5UkVCbCvk+uccFDrqXOvBEIi3oKVwRGHfOX0=";
})
(fetchurl {
url = "https://data.iana.org/time-zones/releases/tzcode${version}.tar.gz";
hash = "sha256-urINlD5ZoyGENfSNhopOVS8Y1tfz3RKGYMVmDIC4oF8=";
})
];
sourceRoot = ".";
@@ -188,7 +188,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib;
};
dontDisableStatic = true;
@@ -268,8 +268,6 @@ stdenv.mkDerivation ({
enableParallelBuilding = true;
inherit enableMultilib enableShared;
inherit (stdenv) is64bit;
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
@@ -74,8 +74,8 @@ let majorVersion = "11";
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
++ optional (stdenv.isDarwin && stdenv.isAarch64) (fetchpatch {
url = "https://github.com/fxcoudert/gcc/compare/releases/gcc-11.1.0...gcc-11.1.0-arm-20210504.diff";
sha256 = "sha256-JqCGJAfbOxSmkNyq49aFHteK/RFsCSLQrL9mzUCnaD0=";
url = "https://github.com/fxcoudert/gcc/compare/releases/gcc-11.2.0...gcc-11.2.0-arm-20211201.diff";
sha256 = "sha256-z62s/cXuH9Kgq/oD/OiiZ8LWnX1xl1D43sONnwaEW1w=";
})
# Obtain latest patch with ../update-mcfgthread-patches.sh
@@ -196,7 +196,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib;
};
dontDisableStatic = true;
@@ -276,8 +276,6 @@ stdenv.mkDerivation ({
enableParallelBuilding = true;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
@@ -191,7 +191,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib;
};
dontDisableStatic = true;
@@ -271,8 +271,6 @@ stdenv.mkDerivation ({
enableParallelBuilding = true;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
@@ -195,7 +195,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform langJava langGo crossStageStatic;
inherit version targetPlatform hostPlatform langJava langGo crossStageStatic enableMultilib;
};
dontDisableStatic = true;
@@ -291,8 +291,6 @@ stdenv.mkDerivation ({
enableParallelBuilding = true;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
@@ -215,7 +215,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform langJava langGo crossStageStatic;
inherit version targetPlatform hostPlatform langJava langGo crossStageStatic enableMultilib;
};
dontDisableStatic = true;
@@ -310,8 +310,6 @@ stdenv.mkDerivation ({
enableParallelBuilding = true;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
+1 -3
View File
@@ -227,7 +227,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform gnatboot langJava langAda langGo crossStageStatic;
inherit version targetPlatform hostPlatform gnatboot langJava langAda langGo crossStageStatic enableMultilib;
};
dontDisableStatic = true;
@@ -322,8 +322,6 @@ stdenv.mkDerivation ({
enableParallelBuilding = true;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
+1 -3
View File
@@ -194,7 +194,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform langGo crossStageStatic;
inherit version targetPlatform hostPlatform langGo crossStageStatic enableMultilib;
};
dontDisableStatic = true;
@@ -276,8 +276,6 @@ stdenv.mkDerivation ({
enableParallelBuilding = true;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
+1 -3
View File
@@ -177,7 +177,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform langGo crossStageStatic;
inherit version targetPlatform hostPlatform langGo crossStageStatic enableMultilib;
};
dontDisableStatic = true;
@@ -255,8 +255,6 @@ stdenv.mkDerivation ({
enableParallelBuilding = true;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
+1 -3
View File
@@ -190,7 +190,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib;
};
dontDisableStatic = true;
@@ -270,8 +270,6 @@ stdenv.mkDerivation ({
enableParallelBuilding = true;
inherit enableShared enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
+6 -1
View File
@@ -193,10 +193,15 @@ preInstall() {
mkdir -p "$out/${targetConfig}/lib"
mkdir -p "${!outputLib}/${targetConfig}/lib"
# Make lib64 symlinks to lib.
if [ -n "$is64bit" -a -z "$enableMultilib" ]; then
if [ -n "$linkLib64toLib" ]; then
ln -s lib "$out/${targetConfig}/lib64"
ln -s lib "${!outputLib}/${targetConfig}/lib64"
fi
# Make lib32 symlinks to lib.
if [ -n "$linkLib32toLib" ]; then
ln -s lib "$out/${targetConfig}/lib32"
ln -s lib "${!outputLib}/${targetConfig}/lib32"
fi
}
@@ -5,6 +5,7 @@
, langJit ? false
, langGo
, crossStageStatic
, enableMultilib
}:
assert langJava -> lib.versionOlder version "7";
@@ -78,3 +79,17 @@ in lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
+ lib.optionalString (targetPlatform != hostPlatform && crossStageStatic) ''
export inhibit_libc=true
''
+ lib.optionalString (!enableMultilib && hostPlatform.is64bit && !hostPlatform.isMips64n32) ''
export linkLib64toLib=1
''
# On mips platforms, gcc follows the IRIX naming convention:
#
# $PREFIX/lib = mips32
# $PREFIX/lib32 = mips64n32
# $PREFIX/lib64 = mips64
#
+ lib.optionalString (!enableMultilib && targetPlatform.isMips64n32) ''
export linkLib32toLib=1
''
@@ -8,7 +8,9 @@
# Example ARM breakage by x86_64 strip: https://bugs.gentoo.org/697428
#
# Let's recap the file layout for directories with object files for a
# cross-compiler (host != target):
# cross-compiler:
#
# $out (host != target)
# `- bin: HOST
# lib/*.{a,o}: HOST
# `- gcc/<TARGET>/<VERSION>/*.{a,o}: TARGET
@@ -17,10 +19,16 @@
# `- libexec/: HOST
# `- <TARGET>/: TARGET
#
# (host == target) has identical directory layout.
# $out (host == target) has identical directory layout.
#
# $lib (host != target):
# `- <TARGET>/lib/*.{la,so}: TARGET
#
# $lib (host == target):
# `- lib/*.{la,so}: HOST
# The rest of stripDebugList{Host,Target} will be populated in
# postInstall.
# postInstall to disambiguate lib/ object files.
stripDebugList = [ "bin" "libexec" ];
stripDebugListTarget = [ stdenv.targetPlatform.config ];
@@ -32,21 +40,28 @@
shopt -s nullglob
pushd $out
local -ar hostFiles=(
lib{,32,64}/*.{a.o}
local -ar outHostFiles=(
lib{,32,64}/*.{a,o,so*}
lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/plugin
)
local -ar targetFiles=(
lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/*.{a.o}
local -ar outTargetFiles=(
lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/*.{a,o,so*}
)
popd
stripDebugList="$stripDebugList ''${hostFiles[*]}"
stripDebugListTarget="$stripDebugListTarget ''${targetFiles[*]}"
pushd $lib
local -ar libHostFiles=(
lib{,32,64}/*.{a,o,so*}
)
local -ar libTargetFiles=(
lib{,32,64}/${stdenv.targetPlatform.config}/*.{a,o,so*}
)
popd
eval "$oldOpts"
stripDebugList="$stripDebugList ''${outHostFiles[*]} ''${libHostFiles[*]}"
stripDebugListTarget="$stripDebugListTarget ''${outTargetFiles[*]} ''${libTargetFiles[*]}"
}
updateDebugListPaths
'';
@@ -9,13 +9,13 @@
}:
stdenv.mkDerivation rec {
pname = "glslang";
version = "1.3.211.0";
version = "1.3.216.0";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "glslang";
rev = "sdk-${version}";
sha256 = "sha256-YLn/Mxuk6mXPGtBBgfwky5Nl1TCAW6i2g+AZLzqVz+A=";
hash = "sha256-sjidkiPtRADhyOEKDb2cHCBXnFjLwk2F5Lppv5/fwNQ=";
};
# These get set at all-packages, keep onto them for child drvs
+5 -10
View File
@@ -3,7 +3,6 @@
, fetchurl
, tzdata
, iana-etc
, runCommand
, perl
, which
, pkg-config
@@ -21,15 +20,7 @@
}:
let
go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { };
goBootstrap = runCommand "go-bootstrap" { } ''
mkdir $out
cp -rf ${go_bootstrap}/* $out/
chmod -R u+w $out
find $out -name "*.c" -delete
cp -rf $out/bin/* $out/share/go/bin/
'';
goBootstrap = buildPackages.callPackage ./bootstrap116.nix { };
goarch = platform: {
"aarch64" = "arm64";
@@ -277,6 +268,10 @@ stdenv.mkDerivation rec {
disallowedReferences = [ goBootstrap ];
passthru = {
inherit goBootstrap;
};
meta = with lib; {
description = "The Go Programming language";
homepage = "https://go.dev/";
+39 -139
View File
@@ -2,34 +2,24 @@
, stdenv
, fetchurl
, tzdata
, substituteAll
, iana-etc
, runCommand
, perl
, which
, pkg-config
, procps
, pcre
, cacert
, Security
, Foundation
, xcbuild
, mailcap
, runtimeShell
, buildPackages
, pkgsBuildTarget
, threadsCross
, testers
, skopeo
, buildGo118Module
}:
let
go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { };
goBootstrap = buildPackages.callPackage ./bootstrap116.nix { };
goBootstrap = runCommand "go-bootstrap" { } ''
mkdir $out
cp -rf ${go_bootstrap}/* $out/
chmod -R u+w $out
find $out -name "*.c" -delete
cp -rf $out/bin/* $out/share/go/bin/
'';
skopeoTest = skopeo.override { buildGoModule = buildGo118Module; };
goarch = platform: {
"aarch64" = "arm64";
@@ -63,126 +53,41 @@ stdenv.mkDerivation rec {
};
strictDeps = true;
# perl is used for testing go vet
nativeBuildInputs = [ perl which pkg-config procps ];
buildInputs = [ cacert pcre ]
buildInputs = [ ]
++ lib.optionals stdenv.isLinux [ stdenv.cc.libc.out ]
++ lib.optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ xcbuild ];
depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Security Foundation ];
depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Foundation Security xcbuild ];
depsBuildTarget = lib.optional isCross targetCC;
depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross;
hardeningDisable = [ "all" ];
prePatch = ''
patchShebangs ./ # replace /bin/bash
# This source produces shell script at run time,
# and thus it is not corrected by patchShebangs.
substituteInPlace misc/cgo/testcarchive/carchive_test.go \
--replace '#!/usr/bin/env bash' '#!${runtimeShell}'
# Patch the mimetype database location which is missing on NixOS.
# but also allow static binaries built with NixOS to run outside nix
sed -i 's,\"/etc/mime.types,"${mailcap}/etc/mime.types\"\,\n\t&,' src/mime/type_unix.go
# Disabling the 'os/http/net' tests (they want files not available in
# chroot builds)
rm src/net/{listen,parse}_test.go
rm src/syscall/exec_linux_test.go
# !!! substituteInPlace does not seems to be effective.
# The os test wants to read files in an existing path. Just don't let it be /usr/bin.
sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go
sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go
# Fails on aarch64
sed -i '/TestFallocate/aif true \{ return\; \}' src/cmd/link/internal/ld/fallocate_test.go
# Skip this test since ssl patches mess it up.
sed -i '/TestLoadSystemCertsLoadColonSeparatedDirs/aif true \{ return\; \}' src/crypto/x509/root_unix_test.go
# Disable another PIE test which breaks.
sed -i '/TestTrivialPIE/aif true \{ return\; \}' misc/cgo/testshared/shared_test.go
# Disable the BuildModePie test
sed -i '/TestBuildmodePIE/aif true \{ return\; \}' src/cmd/go/go_test.go
# Disable the unix socket test
sed -i '/TestShutdownUnix/aif true \{ return\; \}' src/net/net_test.go
# Disable the hostname test
sed -i '/TestHostname/aif true \{ return\; \}' src/os/os_test.go
# ParseInLocation fails the test
sed -i '/TestParseInSydney/aif true \{ return\; \}' src/time/format_test.go
# Remove the api check as it never worked
sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go
# Remove the coverage test as we have removed this utility
sed -i '/TestCoverageWithCgo/aif true \{ return\; \}' src/cmd/go/go_test.go
# Remove the timezone naming test
sed -i '/TestLoadFixed/aif true \{ return\; \}' src/time/time_test.go
# Remove disable setgid test
sed -i '/TestRespectSetgidDir/aif true \{ return\; \}' src/cmd/go/internal/work/build_test.go
# Remove cert tests that conflict with NixOS's cert resolution
sed -i '/TestEnvVars/aif true \{ return\; \}' src/crypto/x509/root_unix_test.go
# TestWritevError hangs sometimes
sed -i '/TestWritevError/aif true \{ return\; \}' src/net/writev_test.go
# TestVariousDeadlines fails sometimes
sed -i '/TestVariousDeadlines/aif true \{ return\; \}' src/net/timeout_test.go
sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go
# Disable cgo lookup tests not works, they depend on resolver
rm src/net/cgo_unix_test.go
# prepend the nix path to the zoneinfo files but also leave the original value for static binaries
# that run outside a nix server
sed -i 's,\"/usr/share/zoneinfo/,"${tzdata}/share/zoneinfo/\"\,\n\t&,' src/time/zoneinfo_unix.go
'' + lib.optionalString stdenv.isAarch32 ''
echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace src/race.bash --replace \
"sysctl machdep.cpu.extfeatures | grep -qv EM64T" true
sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go
sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
sed -i '/TestChdirAndGetwd/aif true \{ return\; \}' src/os/os_test.go
sed -i '/TestCredentialNoSetGroups/aif true \{ return\; \}' src/os/exec/exec_posix_test.go
sed -i '/TestRead0/aif true \{ return\; \}' src/os/os_test.go
sed -i '/TestSystemRoots/aif true \{ return\; \}' src/crypto/x509/root_darwin_test.go
sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/aif true \{ return\; \}' src/cmd/go/go_test.go
sed -i '/TestBuildDashIInstallsDependencies/aif true \{ return\; \}' src/cmd/go/go_test.go
sed -i '/TestDisasmExtld/aif true \{ return\; \}' src/cmd/objdump/objdump_test.go
sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go
# TestCurrent fails because Current is not implemented on Darwin
sed -i 's/TestCurrent/testCurrent/g' src/os/user/user_test.go
sed -i 's/TestLookup/testLookup/g' src/os/user/user_test.go
touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
postPatch = ''
patchShebangs .
'';
patches = [
(substituteAll {
src = ./iana-etc-1.17.patch;
iana = iana-etc;
})
# Patch the mimetype database location which is missing on NixOS.
# but also allow static binaries built with NixOS to run outside nix
(substituteAll {
src = ./mailcap-1.17.patch;
inherit mailcap;
})
# prepend the nix path to the zoneinfo files but also leave the original value for static binaries
# that run outside a nix server
(substituteAll {
src = ./tzdata-1.17.patch;
inherit tzdata;
})
./remove-tools-1.11.patch
./ssl-cert-file-1.16.patch
./remove-test-pie-1.15.patch
./creds-test.patch
./skip-chown-tests-1.16.patch
./skip-external-network-tests-1.16.patch
./skip-nohup-tests.patch
./skip-cgo-tests-1.15.patch
./go_no_vendor_checks-1.16.patch
];
postPatch = ''
find . -name '*.orig' -exec rm {} ';'
'';
GOOS = stdenv.targetPlatform.parsed.kernel.name;
GOARCH = goarch stdenv.targetPlatform;
# GOHOSTOS/GOHOSTARCH must match the building system, not the host system.
@@ -207,16 +112,11 @@ stdenv.mkDerivation rec {
GOARM = toString (lib.intersectLists [ (stdenv.hostPlatform.parsed.cpu.version or "") ] [ "5" "6" "7" ]);
GO386 = "softfloat"; # from Arch: don't assume sse2 on i686
CGO_ENABLED = 1;
# Hopefully avoids test timeouts on Hydra
GO_TEST_TIMEOUT_SCALE = 3;
# Indicate that we are running on build infrastructure
# Some tests assume things like home directories and users exists
GO_BUILDER_NAME = "nix";
GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";
postConfigure = ''
buildPhase = ''
runHook preBuild
export GOCACHE=$TMPDIR/go-cache
# this is compiled into the binary
export GOROOT_FINAL=$out/share/go
@@ -229,18 +129,11 @@ stdenv.mkDerivation rec {
export CC=${buildPackages.stdenv.cc}/bin/cc
''}
ulimit -a
'';
postBuild = ''
(cd src && ./make.bash)
'';
doCheck = stdenv.hostPlatform == stdenv.targetPlatform && !stdenv.isDarwin;
checkPhase = ''
runHook preCheck
(cd src && HOME=$TMPDIR GOCACHE=$TMPDIR/go-cache ./run.bash --no-rebuild)
runHook postCheck
pushd src
./make.bash
popd
runHook postBuild
'';
preInstall = ''
@@ -271,6 +164,13 @@ stdenv.mkDerivation rec {
disallowedReferences = [ goBootstrap ];
passthru = {
inherit goBootstrap skopeoTest;
tests = {
skopeo = testers.testVersion { package = skopeoTest; };
};
};
meta = with lib; {
description = "The Go Programming language";
homepage = "https://go.dev/";
+39 -138
View File
@@ -2,34 +2,24 @@
, stdenv
, fetchurl
, tzdata
, substituteAll
, iana-etc
, runCommand
, perl
, which
, pkg-config
, procps
, pcre
, cacert
, Security
, Foundation
, xcbuild
, mailcap
, runtimeShell
, buildPackages
, pkgsBuildTarget
, threadsCross
, testers
, skopeo
, buildGo119Module
}:
let
go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { };
goBootstrap = buildPackages.callPackage ./bootstrap116.nix { };
goBootstrap = runCommand "go-bootstrap" { } ''
mkdir $out
cp -rf ${go_bootstrap}/* $out/
chmod -R u+w $out
find $out -name "*.c" -delete
cp -rf $out/bin/* $out/share/go/bin/
'';
skopeoTest = skopeo.override { buildGoModule = buildGo119Module; };
goarch = platform: {
"aarch64" = "arm64";
@@ -63,125 +53,41 @@ stdenv.mkDerivation rec {
};
strictDeps = true;
# perl is used for testing go vet
nativeBuildInputs = [ perl which pkg-config procps ];
buildInputs = [ cacert pcre ]
buildInputs = [ ]
++ lib.optionals stdenv.isLinux [ stdenv.cc.libc.out ]
++ lib.optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ xcbuild ];
depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Security Foundation ];
depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Foundation Security xcbuild ];
depsBuildTarget = lib.optional isCross targetCC;
depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross;
hardeningDisable = [ "all" ];
prePatch = ''
patchShebangs ./ # replace /bin/bash
# This source produces shell script at run time,
# and thus it is not corrected by patchShebangs.
substituteInPlace misc/cgo/testcarchive/carchive_test.go \
--replace '#!/usr/bin/env bash' '#!${runtimeShell}'
# Patch the mimetype database location which is missing on NixOS.
# but also allow static binaries built with NixOS to run outside nix
sed -i 's,\"/etc/mime.types,"${mailcap}/etc/mime.types\"\,\n\t&,' src/mime/type_unix.go
# Disabling the 'os/http/net' tests (they want files not available in
# chroot builds)
rm src/net/{listen,parse}_test.go
rm src/syscall/exec_linux_test.go
# !!! substituteInPlace does not seems to be effective.
# The os test wants to read files in an existing path. Just don't let it be /usr/bin.
sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go
sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go
# Fails on aarch64
sed -i '/TestFallocate/aif true \{ return\; \}' src/cmd/link/internal/ld/fallocate_test.go
# Skip this test since ssl patches mess it up.
sed -i '/TestLoadSystemCertsLoadColonSeparatedDirs/aif true \{ return\; \}' src/crypto/x509/root_unix_test.go
# Disable another PIE test which breaks.
sed -i '/TestTrivialPIE/aif true \{ return\; \}' misc/cgo/testshared/shared_test.go
# Disable the BuildModePie test
sed -i '/TestBuildmodePIE/aif true \{ return\; \}' src/cmd/go/go_test.go
# Disable the unix socket test
sed -i '/TestShutdownUnix/aif true \{ return\; \}' src/net/net_test.go
# Disable the hostname test
sed -i '/TestHostname/aif true \{ return\; \}' src/os/os_test.go
# ParseInLocation fails the test
sed -i '/TestParseInSydney/aif true \{ return\; \}' src/time/format_test.go
# Remove the api check as it never worked
sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go
# Remove the coverage test as we have removed this utility
sed -i '/TestCoverageWithCgo/aif true \{ return\; \}' src/cmd/go/go_test.go
# Remove the timezone naming test
sed -i '/TestLoadFixed/aif true \{ return\; \}' src/time/time_test.go
# Remove disable setgid test
sed -i '/TestRespectSetgidDir/aif true \{ return\; \}' src/cmd/go/internal/work/build_test.go
# Remove cert tests that conflict with NixOS's cert resolution
sed -i '/TestEnvVars/aif true \{ return\; \}' src/crypto/x509/root_unix_test.go
# TestWritevError hangs sometimes
sed -i '/TestWritevError/aif true \{ return\; \}' src/net/writev_test.go
# TestVariousDeadlines fails sometimes
sed -i '/TestVariousDeadlines/aif true \{ return\; \}' src/net/timeout_test.go
sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go
# Disable cgo lookup tests not works, they depend on resolver
rm src/net/cgo_unix_test.go
# prepend the nix path to the zoneinfo files but also leave the original value for static binaries
# that run outside a nix server
sed -i 's,\"/usr/share/zoneinfo/,"${tzdata}/share/zoneinfo/\"\,\n\t&,' src/time/zoneinfo_unix.go
'' + lib.optionalString stdenv.isAarch32 ''
echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace src/race.bash --replace \
"sysctl machdep.cpu.extfeatures | grep -qv EM64T" true
sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go
sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
sed -i '/TestChdirAndGetwd/aif true \{ return\; \}' src/os/os_test.go
sed -i '/TestCredentialNoSetGroups/aif true \{ return\; \}' src/os/exec/exec_posix_test.go
sed -i '/TestRead0/aif true \{ return\; \}' src/os/os_test.go
sed -i '/TestSystemRoots/aif true \{ return\; \}' src/crypto/x509/root_darwin_test.go
sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/aif true \{ return\; \}' src/cmd/go/go_test.go
sed -i '/TestBuildDashIInstallsDependencies/aif true \{ return\; \}' src/cmd/go/go_test.go
sed -i '/TestDisasmExtld/aif true \{ return\; \}' src/cmd/objdump/objdump_test.go
sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go
# TestCurrent fails because Current is not implemented on Darwin
sed -i 's/TestCurrent/testCurrent/g' src/os/user/user_test.go
sed -i 's/TestLookup/testLookup/g' src/os/user/user_test.go
touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
postPatch = ''
patchShebangs .
'';
patches = [
(substituteAll {
src = ./iana-etc-1.17.patch;
iana = iana-etc;
})
# Patch the mimetype database location which is missing on NixOS.
# but also allow static binaries built with NixOS to run outside nix
(substituteAll {
src = ./mailcap-1.17.patch;
inherit mailcap;
})
# prepend the nix path to the zoneinfo files but also leave the original value for static binaries
# that run outside a nix server
(substituteAll {
src = ./tzdata-1.19.patch;
inherit tzdata;
})
./remove-tools-1.11.patch
./ssl-cert-file-1.16.patch
./remove-test-pie-1.15.patch
./skip-chown-tests-1.16.patch
./skip-external-network-tests-1.16.patch
./skip-nohup-tests.patch
./skip-cgo-tests-1.19.patch
./go_no_vendor_checks-1.16.patch
];
postPatch = ''
find . -name '*.orig' -exec rm {} ';'
'';
GOOS = stdenv.targetPlatform.parsed.kernel.name;
GOARCH = goarch stdenv.targetPlatform;
# GOHOSTOS/GOHOSTARCH must match the building system, not the host system.
@@ -206,16 +112,11 @@ stdenv.mkDerivation rec {
GOARM = toString (lib.intersectLists [ (stdenv.hostPlatform.parsed.cpu.version or "") ] [ "5" "6" "7" ]);
GO386 = "softfloat"; # from Arch: don't assume sse2 on i686
CGO_ENABLED = 1;
# Hopefully avoids test timeouts on Hydra
GO_TEST_TIMEOUT_SCALE = 3;
# Indicate that we are running on build infrastructure
# Some tests assume things like home directories and users exists
GO_BUILDER_NAME = "nix";
GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";
postConfigure = ''
buildPhase = ''
runHook preBuild
export GOCACHE=$TMPDIR/go-cache
# this is compiled into the binary
export GOROOT_FINAL=$out/share/go
@@ -228,18 +129,11 @@ stdenv.mkDerivation rec {
export CC=${buildPackages.stdenv.cc}/bin/cc
''}
ulimit -a
'';
postBuild = ''
(cd src && ./make.bash)
'';
doCheck = stdenv.hostPlatform == stdenv.targetPlatform && !stdenv.isDarwin;
checkPhase = ''
runHook preCheck
(cd src && HOME=$TMPDIR GOCACHE=$TMPDIR/go-cache ./run.bash --no-rebuild)
runHook postCheck
pushd src
./make.bash
popd
runHook postBuild
'';
preInstall = ''
@@ -270,6 +164,13 @@ stdenv.mkDerivation rec {
disallowedReferences = [ goBootstrap ];
passthru = {
inherit goBootstrap skopeoTest;
tests = {
skopeo = testers.testVersion { package = skopeoTest; };
};
};
meta = with lib; {
description = "The Go Programming language";
homepage = "https://go.dev/";
+4 -7
View File
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, version, hashes }:
{ lib, stdenv, fetchurl, version, hashes, autoPatchelfHook }:
let
toGoKernel = platform:
if platform.isDarwin then "darwin"
@@ -25,19 +25,16 @@ stdenv.mkDerivation rec {
sha256 = hashes.${platform} or (throw "Missing Go bootstrap hash for platform ${platform}");
};
nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
# We must preserve the signature on Darwin
dontStrip = stdenv.hostPlatform.isDarwin;
installPhase = ''
runHook preInstall
mkdir -p $out/share/go $out/bin
mv bin/* $out/bin
cp -r . $out/share/go
${lib.optionalString stdenv.isLinux (''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
$out/bin/go
'')}
ln -s $out/share/go/bin/go $out/bin/go
runHook postInstall
'';
}
@@ -0,0 +1,26 @@
diff --git a/src/net/lookup_unix.go b/src/net/lookup_unix.go
index 8030e3d99e..5a7472d933 100644
--- a/src/net/lookup_unix.go
+++ b/src/net/lookup_unix.go
@@ -21,7 +21,7 @@ var onceReadProtocols sync.Once
// readProtocols loads contents of /etc/protocols into protocols map
// for quick access.
func readProtocols() {
- file, err := open("/etc/protocols")
+ file, err := open("@iana@/etc/protocols")
if err != nil {
return
}
diff --git a/src/net/port_unix.go b/src/net/port_unix.go
index a9a96a2323..0df6efe9e5 100644
--- a/src/net/port_unix.go
+++ b/src/net/port_unix.go
@@ -17,7 +17,7 @@ import (
var onceReadServices sync.Once
func readServices() {
- file, err := open("/etc/services")
+ file, err := open("@iana@/etc/services")
if err != nil {
return
}
@@ -0,0 +1,12 @@
diff --git a/src/mime/type_unix.go b/src/mime/type_unix.go
index f954bc8a1f..06d897bfbf 100644
--- a/src/mime/type_unix.go
+++ b/src/mime/type_unix.go
@@ -26,6 +26,7 @@ var mimeGlobs = []string{
// Common locations for mime.types files on unix.
var typeFiles = []string{
+ "@mailcap@/etc/mime.types",
"/etc/mime.types",
"/etc/apache2/mime.types",
"/etc/apache/mime.types",
@@ -1,13 +0,0 @@
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index e1cd4965c3..0980d044df 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -1136,7 +1136,7 @@ func (t *tester) cgoTest(dt *distTest) error {
t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie", "-ldflags=-linkmode=internal")
}
t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-buildmode=pie", ".")
- t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-buildmode=pie", ".")
+ //t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-buildmode=pie", ".")
}
}
}
@@ -0,0 +1,12 @@
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
index 4ea029dbde..af94a4d90b 100644
--- a/src/time/zoneinfo_unix.go
+++ b/src/time/zoneinfo_unix.go
@@ -20,6 +20,7 @@ import (
// Many systems use /usr/share/zoneinfo, Solaris 2 has
// /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ.
var zoneSources = []string{
+ "@tzdata@/share/zoneinfo/",
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
@@ -0,0 +1,12 @@
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
index 67b8beb47b..5cd1fb1759 100644
--- a/src/time/zoneinfo_unix.go
+++ b/src/time/zoneinfo_unix.go
@@ -18,6 +18,7 @@ import (
// Many systems use /usr/share/zoneinfo, Solaris 2 has
// /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ.
var platformZoneSources = []string{
+ "@tzdata@/share/zoneinfo/",
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
@@ -20,8 +20,8 @@
} @ args:
import ./default.nix {
rustcVersion = "1.62.1";
rustcSha256 = "sha256-cqy+b/zZT1mDgqdDCw2F7o9nnm0LJ/P1Zu0cFsl4Ez8=";
rustcVersion = "1.63.0";
rustcSha256 = "1l4rrbzhxv88pnfq94nbyb9m6lfnjwixma3mwjkmvvs2aqlq158z";
llvmSharedForBuild = pkgsBuildBuild.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
llvmSharedForHost = pkgsBuildHost.llvmPackages_14.libllvm.override { enableSharedLibraries = true; };
@@ -37,25 +37,25 @@ import ./default.nix {
# Note: the version MUST be one version prior to the version we're
# building
bootstrapVersion = "1.61.0";
bootstrapVersion = "1.62.1";
# fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
bootstrapHashes = {
i686-unknown-linux-gnu = "b15eb0ad44b7253e0b5b1a8cd285feb10e9fb0402840dba9a13112c3349a4b39";
x86_64-unknown-linux-gnu = "066b324239d30787ce64142d7e04912f2e1850c07db3b2354d8654e02ff8b23a";
x86_64-unknown-linux-musl = "0904f6b769ae28c259e0e25a41e99290a4ae2a36bca63ae153790b2ebbc427bf";
arm-unknown-linux-gnueabihf = "cc32705cd1b583aaac74e6663f71392131dc0355a0f484cb56f0378b71ea7ebc";
armv7-unknown-linux-gnueabihf = "2782ec75ea4abb402513e2e57becc6c14e67b492d57228cddedef6db0853b165";
aarch64-unknown-linux-gnu = "261cd47bc3c98c9f97b601d1ad2a7d9b33c9ea63c9a351119c2f6d4e82f5d436";
aarch64-unknown-linux-musl = "feb79985cb161a10b252236852df8db3bf3593c78905b84c7e94cd4454327e47";
x86_64-apple-darwin = "d851f1a473926a5d8f111ed08002047a5dc4ad944a5b7f8d5d2f1f266b51e66a";
aarch64-apple-darwin = "2dbafd13d007543aada47179fa273f9a3865f27e0a07bd69be61801232a0819e";
powerpc64le-unknown-linux-gnu = "6d5cd579b68a2adc20384406c69a92beaaf4941056e126ff0ed1ec2f3a4e721f";
riscv64gc-unknown-linux-gnu = "3d0f3b1a8522e09fffdf920a061794ac3107410eb1fe8f5d62a7aae3c6dcb81e";
mips64el-unknown-linux-gnuabi64 = "6ed5b6492e68f45488108abd06dbcd4b89c46cdbd4715331bb11e88f18500815";
i686-unknown-linux-gnu = "1669163ffe01e252ffb62da7d84949378fc274931a65ac827d54059a5ffc542c";
x86_64-unknown-linux-gnu = "dd7d82b8fa8eae59729e1c31fe59a9de6ee61d08ab40ce016185653beebe04d2";
x86_64-unknown-linux-musl = "32bee487074b105e2582cddce35934a6019eec74bae3f9300fdc3edfcf5b66d4";
arm-unknown-linux-gnueabihf = "5c735e8174d394936d7b499c2d147ddadf3c4d77e652d1e0b0a72d9d09f81ea4";
armv7-unknown-linux-gnueabihf = "26fa731385f1a71211ba8e3c94f3bb3b1a82bde89f8d4dcf75b4b463b57b0f88";
aarch64-unknown-linux-gnu = "1311fa8204f895d054c23a3481de3b158a5cd3b3a6338761fee9cdf4dbf075a5";
aarch64-unknown-linux-musl = "73bbab4d8a9e3c416035d40406e656ab37e785df35fa069a33af52e931a24b12";
x86_64-apple-darwin = "0a04dcf2b521239826f3eaa66d77169d91e68087ccc3107b54e8aba7c02c9adf";
aarch64-apple-darwin = "6d1671ea31b05cab5e2587cc2b295b3e7232b0135f0977355618e2a01933ff0a";
powerpc64le-unknown-linux-gnu = "1d3248e1a673cda87cf443cd4334ff5fb53e6f87c72d3587b07e5c0cb507f3ae";
riscv64gc-unknown-linux-gnu = "fd378d0bf866689e8111aba0e2b020da87f32f70fb11d98a575d42dc05978c2a";
mips64el-unknown-linux-gnuabi64 = "b7c47dd94728161aa96762fb7bc51b6ab0feba7c5215d06eaea5b78649815a96";
};
selectRustPackage = pkgs: pkgs.rust_1_62;
selectRustPackage = pkgs: pkgs.rust_1_63;
rustcPatches = [
];
+8 -26
View File
@@ -1,4 +1,5 @@
{ lib, stdenv, makeWrapper, bash, curl, darwin, zlib
, autoPatchelfHook, gcc
, version
, src
, platform
@@ -31,7 +32,9 @@ rec {
license = [ licenses.mit licenses.asl20 ];
};
nativeBuildInputs = lib.optional (!stdenv.isDarwin) autoPatchelfHook;
buildInputs = [ bash ]
++ lib.optionals (!stdenv.isDarwin) [ gcc.cc.lib zlib ]
++ lib.optional stdenv.isDarwin Security;
postPatch = ''
@@ -42,24 +45,6 @@ rec {
./install.sh --prefix=$out \
--components=${installComponents}
${optionalString (stdenv.isLinux && bootstrapping) (''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustc"
'' + optionalString (lib.versionAtLeast version "1.46")
# rustc bootstrap needs libz starting from 1.46
''
ln -s ${zlib}/lib/libz.so.1 $out/lib/libz.so.1
ln -s ${zlib}/lib/libz.so $out/lib/libz.so
'' + ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustdoc"
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/cargo"
'')}
# Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc
# (or similar) here. It causes strange effects where rustc loads
# the wrong libraries in a bootstrap-build causing failures that
@@ -83,8 +68,11 @@ rec {
license = [ licenses.mit licenses.asl20 ];
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ bash ] ++ lib.optional stdenv.isDarwin Security;
nativeBuildInputs = [ makeWrapper ]
++ lib.optional (!stdenv.isDarwin) autoPatchelfHook;
buildInputs = [ bash ]
++ lib.optional (!stdenv.isDarwin) gcc.cc.lib
++ lib.optional stdenv.isDarwin Security;
postPatch = ''
patchShebangs .
@@ -95,12 +83,6 @@ rec {
./install.sh --prefix=$out \
--components=cargo
${optionalString (stdenv.isLinux && bootstrapping) ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/cargo"
''}
wrapProgram "$out/bin/cargo" \
--suffix PATH : "${rustc}/bin"
'';
@@ -72,5 +72,7 @@ rustPlatform.buildRustPackage {
maintainers = with maintainers; [ retrry ];
license = [ licenses.mit licenses.asl20 ];
platforms = platforms.unix;
# weird segfault in a build script
broken = stdenv.targetPlatform.isMusl && !stdenv.targetPlatform.isStatic;
};
}
+4 -3
View File
@@ -87,6 +87,10 @@ in stdenv.mkDerivation rec {
"${setBuild}.cxx=${cxxForBuild}"
"${setHost}.cxx=${cxxForHost}"
"${setTarget}.cxx=${cxxForTarget}"
"${setBuild}.crt-static=${lib.boolToString stdenv.buildPlatform.isStatic}"
"${setHost}.crt-static=${lib.boolToString stdenv.hostPlatform.isStatic}"
"${setTarget}.crt-static=${lib.boolToString stdenv.targetPlatform.isStatic}"
] ++ optionals (!withBundledLLVM) [
"--enable-llvm-link-shared"
"${setBuild}.llvm-config=${llvmSharedForBuild.dev}/bin/llvm-config"
@@ -188,8 +192,5 @@ in stdenv.mkDerivation rec {
maintainers = with maintainers; [ madjar cstrahan globin havvy ];
license = [ licenses.mit licenses.asl20 ];
platforms = platforms.linux ++ platforms.darwin;
# rustc can't generate binaries for dynamically linked Musl.
# https://github.com/NixOS/nixpkgs/issues/179242
broken = stdenv.targetPlatform.isMusl && !stdenv.targetPlatform.isStatic;
};
}
@@ -3,16 +3,16 @@
rustPlatform.buildRustPackage rec {
pname = "evcxr";
version = "0.12.0";
version = "0.13.0";
src = fetchFromGitHub {
owner = "google";
repo = "evcxr";
rev = "v${version}";
sha256 = "sha256-sD/eykXoeJq43o3xyFx2VIoH+xZrMmb6vZKVt4CO7B4=";
sha256 = "sha256-n9wDO4HIWLINbqGVxaZyAEFVDLLnSpQLKlFf20jLq6o=";
};
cargoSha256 = "sha256-eySdhzavm9NGv2xjgdq/C2iv6lxdulhgYNs9ehnSzKQ=";
cargoSha256 = "sha256-zdIJb9fXRByyAJ32RL9lQh6oS1K78IlZfWdJyj+MMZM=";
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
@@ -430,11 +430,6 @@ in with passthru; stdenv.mkDerivation {
# This allows build Python to import host Python's sysconfigdata
mkdir -p "$out/${sitePackages}"
ln -s "$out/lib/${libPrefix}/"_sysconfigdata*.py "$out/${sitePackages}/"
# debug info can't be separated from a static library and would otherwise be
# left in place by a separateDebugInfo build. force its removal here to save
# space in output.
$STRIP -S $out/lib/${libPrefix}/config-*/libpython*.a || true
'' + optionalString stripConfig ''
rm -R $out/bin/python*-config $out/lib/python*/config-*
'' + optionalString stripIdlelib ''
@@ -164,6 +164,14 @@ in rec {
};
} ./setuptools-check-hook.sh) {};
unittestCheckHook = callPackage ({ }:
makeSetupHook {
name = "unittest-check-hook";
substitutions = {
inherit pythonCheckInterpreter;
};
} ./unittest-check-hook.sh) {};
venvShellHook = disabledIf (!isPy3k) (callPackage ({ }:
makeSetupHook {
name = "venv-shell-hook";
@@ -0,0 +1,29 @@
# Setup hook for unittest.
echo "Sourcing unittest-check-hook"
unittestCheckPhase() {
echo "Executing unittestCheckPhase"
runHook preCheck
eval "@pythonCheckInterpreter@ -m unittest discover $unittestFlagsArray"
runHook postCheck
echo "Finished executing unittestCheckPhase"
}
if [ -z "${dontUseUnittestCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
echo "Using unittestCheckPhase"
preDistPhases+=" unittestCheckPhase"
# It's almost always the case that setuptoolsCheckPhase should not be ran
# when the unittestCheckHook is being ran
if [ -z "${useSetuptoolsCheck-}" ]; then
dontUseSetuptoolsCheck=1
# Remove command if already injected into preDistPhases
if [[ "$preDistPhases" =~ "setuptoolsCheckPhase" ]]; then
echo "Removing setuptoolsCheckPhase"
preDistPhases=${preDistPhases/setuptoolsCheckPhase/}
fi
fi
fi
@@ -19,7 +19,6 @@ let
generic = { version, sha256 }: let
ver = version;
tag = ver.gitTag;
atLeast30 = lib.versionAtLeast ver.majMin "3.0";
self = lib.makeOverridable (
{ stdenv, buildPackages, lib
@@ -225,8 +224,8 @@ let
++ op useBaseRuby baseRuby;
meta = with lib; {
description = "The Ruby language";
homepage = "http://www.ruby-lang.org/en/";
description = "An object-oriented language for quick and easy programming";
homepage = "https://www.ruby-lang.org/";
license = licenses.ruby;
maintainers = with maintainers; [ vrthra manveru marsam ];
platforms = platforms.all;
@@ -248,11 +247,6 @@ let
ruby = self;
}) withPackages gems;
# deprecated 2016-09-21
majorVersion = ver.major;
minorVersion = ver.minor;
teenyVersion = ver.tiny;
patchLevel = ver.patchLevel;
} // lib.optionalAttrs useBaseRuby {
inherit baseRuby;
};
@@ -2,14 +2,19 @@
{
"2.7.6" = ops useRailsExpress [
"${patchSet}/patches/ruby/2.7/head/railsexpress/01-fix-broken-tests-caused-by-ad.patch"
"${patchSet}/patches/ruby/2.7/head/railsexpress/02-improve-gc-stats.patch"
"${patchSet}/patches/ruby/2.7/head/railsexpress/03-more-detailed-stacktrace.patch"
"${patchSet}/patches/ruby/2.7/head/railsexpress/01-fix-with-openssl-dir-option.patch"
"${patchSet}/patches/ruby/2.7/head/railsexpress/02-fix-broken-tests-caused-by-ad.patch"
"${patchSet}/patches/ruby/2.7/head/railsexpress/03-improve-gc-stats.patch"
"${patchSet}/patches/ruby/2.7/head/railsexpress/04-more-detailed-stacktrace.patch"
"${patchSet}/patches/ruby/2.7/head/railsexpress/05-malloc-trim.patch"
];
"3.0.4" = ops useRailsExpress [
"${patchSet}/patches/ruby/3.0/head/railsexpress/01-improve-gc-stats.patch"
"${patchSet}/patches/ruby/3.0/head/railsexpress/02-malloc-trim.patch"
"${patchSet}/patches/ruby/3.0/head/railsexpress/01-fix-with-openssl-dir-option.patch"
"${patchSet}/patches/ruby/3.0/head/railsexpress/02-improve-gc-stats.patch"
"${patchSet}/patches/ruby/3.0/head/railsexpress/03-malloc-trim.patch"
];
"3.1.2" = ops useRailsExpress [ # no patches yet (2021-12-25)
"3.1.2" = ops useRailsExpress [
"${patchSet}/patches/ruby/3.1/head/railsexpress/01-improve-gc-stats.patch"
"${patchSet}/patches/ruby/3.1/head/railsexpress/02-malloc-trim.patch"
];
}
@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "rubygems";
version = "3.2.26";
version = "3.3.20";
src = fetchurl {
url = "https://rubygems.org/rubygems/rubygems-${version}.tgz";
sha256 = "sha256-9wa6lOWnua8zBblQKRgjjiTVPYp2TW0n7XOvgW7u1e8=";
sha256 = "sha256-VTUMZ2mqbszM7uXOYV6Grg7dkeGAGVXYjBX0hA/vOTg=";
};
patches = [
@@ -3,6 +3,6 @@
fetchFromGitHub {
owner = "skaes";
repo = "rvm-patchsets";
rev = "0251817e2b9d5f73370bbbb12fdf7f7089bd1ac3";
sha256 = "1biiq5xzzdfb4hr1sgmx14i2nr05xa9w21pc7dl8c5n4f2ilg8ss";
rev = "a6429bb1a7fb9b5798c22f43338739a6c192b42d";
sha256 = "sha256-NpSa+uGQA1rfHNcLzPNTK65J+Wk9ZlzhHFePDA4uuo0=";
}
@@ -31,8 +31,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ];
passthru.tests.static = pkgsStatic.giflib;
meta = {
+2 -2
View File
@@ -31,13 +31,13 @@ let
];
in stdenv.mkDerivation rec {
pname = "gjs";
version = "1.72.1";
version = "1.72.2";
outputs = [ "out" "dev" "installedTests" ];
src = fetchurl {
url = "mirror://gnome/sources/gjs/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "sha256-F8Cx7D8JZnH/i/q6bku/FBmMcBPGBL/Wd6mFjaB5wKs=";
sha256 = "sha256-3e43m9xafTA6XYlL4rKBvrisVFCGBOfT8geBqGnaOXc=";
};
patches = [
+19 -2
View File
@@ -1,5 +1,5 @@
{ config, lib, stdenv, fetchurl, gettext, meson, ninja, pkg-config, perl, python3
, libiconv, zlib, libffi, pcre, libelf, gnome, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45
, libiconv, zlib, libffi, pcre, libelf, gnome, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45, libxslt
# use util-linuxMinimal to avoid circular dependency (util-linux, systemd, glib)
, util-linuxMinimal ? null
, buildPackages
@@ -124,7 +124,7 @@ stdenv.mkDerivation rec {
(buildPackages.meson.override {
withDarwinFrameworksGtkDocPatch = stdenv.isDarwin;
})
ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2
ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2 libxslt
];
propagatedBuildInputs = [ zlib libffi gettext libiconv ];
@@ -135,6 +135,8 @@ stdenv.mkDerivation rec {
"-Dgtk_doc=${boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}"
"-Dnls=enabled"
"-Ddevbindir=${placeholder "dev"}/bin"
] ++ optionals (!stdenv.isDarwin) [
"-Dman=true" # broken on Darwin
];
NIX_CFLAGS_COMPILE = toString [
@@ -167,10 +169,25 @@ stdenv.mkDerivation rec {
# This file is *included* in gtk3 and would introduce runtime reference via __FILE__.
sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \
-i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
for i in $bin/bin/*; do
moveToOutput "share/bash-completion/completions/''${i##*/}" "$bin"
done
for i in $dev/bin/*; do
moveToOutput "share/bash-completion/completions/''${i##*/}" "$dev"
done
'' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
cp -r ${buildPackages.glib.devdoc} $devdoc
'';
# Move man pages to the same output as their binaries (needs to be
# done after preFixupHooks which moves man pages too - in
# _multioutDocs)
postFixup = ''
for i in $dev/bin/*; do
moveToOutput "share/man/man1/''${i##*/}.1.*" "$dev"
done
'';
checkInputs = [ tzdata desktop-file-utils shared-mime-info ];
preCheck = optionalString doCheck ''
@@ -127,15 +127,6 @@ callPackage ./common.nix { inherit stdenv; } {
ln -sf $out/lib/libdl.so.2 $out/lib/libdl.so
ln -sf $out/lib/libutil.so.1 $out/lib/libutil.so
touch $out/lib/libpthread.a
''
# For some reason these aren't stripped otherwise and retain reference
# to bootstrap-tools; on cross-arm this stripping would break objects.
+ lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
for i in "$out"/lib/*.a; do
[ "$i" = "$out/lib/libm.a" ] || $STRIP -S "$i"
done
'' + ''
# Put libraries for static linking in a separate output. Note
# that libc_nonshared.a and libpthread_nonshared.a are required
+2 -12
View File
@@ -5,23 +5,13 @@ with lib;
stdenv.mkDerivation rec {
pname = "gnu-efi";
version = "3.0.14";
version = "3.0.15";
src = fetchurl {
url = "mirror://sourceforge/gnu-efi/${pname}-${version}.tar.bz2";
sha256 = "tztkOg1Wl9HzltdDFEjoht2AVmh4lXjj4aKCd8lShDU=";
sha256 = "sha256-kxole5xcG6Zf9Rnxg3PEOKJoJfLbeGaxY+ltGxaPIOo=";
};
patches = [
# Pull fix pending upstream inclusion for parallel builds
# https://sourceforge.net/p/gnu-efi/patches/84/
(fetchurl {
name = "parallel-build.patch";
url = "https://sourceforge.net/p/gnu-efi/patches/84/attachment/0001-lib-Makefile-add-.o-file-dependency-on-libsubdirs-ta.patch";
sha256 = "sha256-+2UwV2lopdB/tazib1BLzO1E3GgB1L8dZsSQKWVoLwA=";
})
];
buildInputs = [ pciutils ];
hardeningDisable = [ "stackprotector" ];
@@ -22,11 +22,11 @@ in
stdenv.mkDerivation rec {
pname = "gnutls";
version = "3.7.6";
version = "3.7.7";
src = fetchurl {
url = "mirror://gnupg/gnutls/v${lib.versions.majorMinor version}/gnutls-${version}.tar.xz";
sha256 = "1zv2097v9f6f4c66q7yn3c6gggjk9jz38095ma7v3gs5lccmf1kp";
sha256 = "sha256-vpFD0NWOq2TbqbdxFKqvrFKbbA1+gd5r3xybWQJ9IQY=";
};
outputs = [ "bin" "dev" "out" "man" "devdoc" ];
@@ -8,13 +8,13 @@
stdenv.mkDerivation rec {
pname = "gperftools";
version = "2.9.1";
version = "2.10";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "${pname}-${version}";
sha256 = "sha256-loUlC6mtR3oyS5opSmicCnfUqcefSk8+kKDcHNmC/oo=";
sha256 = "sha256-lUX9T31cYZEi+0DgF52EDSL9yiSHa8ToMxhpQFKHOGk=";
};
patches = [
@@ -28,8 +28,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook ];
# tcmalloc uses libunwind in a way that works correctly only on non-ARM linux
buildInputs = lib.optional (stdenv.isLinux && !stdenv.hostPlatform.isAarch) libunwind;
# tcmalloc uses libunwind in a way that works correctly only on non-ARM dynamically linked linux
buildInputs = lib.optional (stdenv.isLinux && !(stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isStatic )) libunwind;
# Disable general dynamic TLS on AArch to support dlopen()'ing the library:
# https://bugzilla.redhat.com/show_bug.cgi?id=1483558
+2 -2
View File
@@ -27,11 +27,11 @@ let
in
stdenv.mkDerivation rec {
pname = "gpgme";
version = "1.17.1";
version = "1.18.0";
src = fetchurl {
url = "mirror://gnupg/gpgme/${pname}-${version}.tar.bz2";
hash = "sha256-cR6r9d1mG5sEvp7cms4qe8Ax9r2dN6do0C0O/e8Qj18=";
hash = "sha256-Nh1OrkfOkl26DqVpr0DntSxkXEri5l5WIb8bbN2LDp4=";
};
patches = [
+2 -2
View File
@@ -10,11 +10,11 @@ in
stdenv.mkDerivation rec {
pname = "gsm";
version = "1.0.19";
version = "1.0.20";
src = fetchurl {
url = "http://www.quut.com/gsm/${pname}-${version}.tar.gz";
sha256 = "1xkha9ss5g5qnfaybi8il0mcvp8knwg9plgh8404vh58d0pna0s9";
sha256 = "sha256-YxXDhRi4HomcP8LtRjzGI68pxcIxpIwTeyQwIjSukL8=";
};
patchPhase = ''
@@ -31,6 +31,6 @@ stdenv.mkDerivation rec {
description = "Small library for playing system sounds";
maintainers = teams.gnome.members;
license = licenses.gpl2;
platforms = platforms.linux;
platforms = platforms.unix;
};
}
@@ -98,13 +98,13 @@
stdenv.mkDerivation rec {
pname = "gst-plugins-bad";
version = "1.20.1";
version = "1.20.3";
outputs = [ "out" "dev" ];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "0j1q89dl8369djibc5p27lyj8y8p4maplmdzlryvrw0ib77w5lq9";
sha256 = "sha256-ehHBO1XdHSOG3ZAiGeQcv83ajh4Ko+c4GGyVB0s12k8=";
};
nativeBuildInputs = [
@@ -41,13 +41,13 @@
stdenv.mkDerivation rec {
pname = "gst-plugins-base";
version = "1.20.1";
version = "1.20.3";
outputs = [ "out" "dev" ];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "0162ly7pscymq6bsf1d5fva2k9s16zvfwyi1q6z4yfd97d0sdn4n";
sha256 = "sha256-fjCz3YGnA4D/dVT5mEcdaZb/drvm/FRHCW+FHiRHPJ8=";
};
strictDeps = true;
@@ -21,7 +21,7 @@
stdenv.mkDerivation rec {
pname = "gstreamer";
version = "1.20.1";
version = "1.20.3";
outputs = [
"bin"
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "0cghi6n4nhdbajz3wqcgbh5xm94myvnqgsi9g2bz9n1s9904l2fy";
sha256 = "sha256-YH2vZLu9X7GK+dF+IcDSLE1wL//oOyPLItGxryyiOio=";
};
depsBuildBuild = [
@@ -6,6 +6,8 @@
, pkg-config
, gstreamer
, gst-plugins-base
, gst-plugins-bad
, gst-rtsp-server
, python3
, gobject-introspection
, json-glib
@@ -13,11 +15,11 @@
stdenv.mkDerivation rec {
pname = "gst-devtools";
version = "1.20.1";
version = "1.20.3";
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "0asbapgf485h2gqq0sn9c4qknwi0ccpraf1685ixp2sv23pwgwc1";
sha256 = "sha256-u71F6tcDNn6o9L6bPAgte2K+9HskCjkIPyeETih1jEc=";
};
outputs = [
@@ -50,6 +52,8 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [
gstreamer
gst-plugins-base
gst-plugins-bad
gst-rtsp-server
];
mesonFlags = [
@@ -16,7 +16,7 @@
stdenv.mkDerivation rec {
pname = "gst-editing-services";
version = "1.20.1";
version = "1.20.3";
outputs = [
"out"
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "1ps887yyj6jkj8a2613n43b4fbvynxwryinxvavi00cfnlhipkka";
sha256 = "sha256-X9iW3mn74kQh62sP+NL4tMPLo/MCXOrNMCFy85qKuqI=";
};
nativeBuildInputs = [
@@ -49,13 +49,13 @@ assert raspiCameraSupport -> (stdenv.isLinux && stdenv.isAarch64);
stdenv.mkDerivation rec {
pname = "gst-plugins-good";
version = "1.20.1";
version = "1.20.3";
outputs = [ "out" "dev" ];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "1al4f35mx41cy2h6agvmsqkjfchsyfs0iyxzpv6pnl0xh9pqfriw";
sha256 = "sha256-+PPCBr9c2rwAlTkgtHs1da8O8V6fhxwLaWb20KpYaLc=";
};
strictDeps = true;
@@ -16,11 +16,11 @@
stdenv.mkDerivation rec {
pname = "gst-libav";
version = "1.20.1";
version = "1.20.3";
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "1iwz7928yi48xia5kfkj54x5dfmhbj25g9125vainpmp6fv1z9wi";
sha256 = "sha256-P+3RBWD836obZGLL95o4xOe1fX85A1k5P8DO9tvyff4=";
};
outputs = [ "out" "dev" ];
@@ -13,11 +13,11 @@
stdenv.mkDerivation rec {
pname = "gst-rtsp-server";
version = "1.20.1";
version = "1.20.3";
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "028maajlvfn96v3gqk2ws1k6w9hjfk7dsxnm84d73pnpi99bqia7";
sha256 = "sha256-7kAnGL6bEn8OXmbKTBtPQuSSbsk7owe3zMpdxsyXlMo=";
};
outputs = [
@@ -24,13 +24,13 @@
stdenv.mkDerivation rec {
pname = "gst-plugins-ugly";
version = "1.20.1";
version = "1.20.3";
outputs = [ "out" "dev" ];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "06fvgyjwcf4paqxgp1xmgd0d0glkxys7n818526k10wrw92m20s2";
sha256 = "sha256-jKogeJoJwwS0nPVj0zzKlCGxh1uE/MGH5KOF+gHWrv0=";
};
nativeBuildInputs = [
@@ -21,11 +21,11 @@
stdenv.mkDerivation rec {
pname = "gstreamer-vaapi";
version = "1.20.1";
version = "1.20.3";
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
sha256 = "0dqiy8mhcpq3yla8dk69pkjid7hiv98ykvwskb4pk45g6z2zdyw7";
sha256 = "sha256-bumesxar3emtNwApFb2MOGeRj2/cdLfPKsTBrg1pC0U=";
};
outputs = [
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, pkg-config
, glib
, freetype
@@ -30,7 +31,7 @@
}:
let
version = "5.0.1";
version = "5.1.0";
inherit (lib) optional optionals optionalString;
mesonFeatureFlag = opt: b:
"-D${opt}=${if b then "enabled" else "disabled"}";
@@ -44,9 +45,17 @@ stdenv.mkDerivation {
owner = "harfbuzz";
repo = "harfbuzz";
rev = version;
sha256 = "sha256-01hpSTesPpUO2T9v1sq3VvCSFEOMyaxbHhX0vS1ms/k=";
sha256 = "sha256-K6iScmg1vNfwb1UYqtXsnijLVpcC+am2ZL+W5bLFzsI=";
};
patches = [
(fetchpatch {
name = "aarch64-test-narrowing.diff";
url = "https://github.com/harfbuzz/harfbuzz/commit/04d28d94e576aab099891e6736fd0088dfac3366.diff";
sha256 = "sha256-099GP8t1G0kyYl79A6xJhfyrs3WXYitvn+He7sEz+Oo=";
})
];
postPatch = ''
patchShebangs src/*.py test
'' + lib.optionalString stdenv.isDarwin ''
@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "iso-codes";
version = "4.9.0";
version = "4.11.0";
src = fetchurl {
url = "https://salsa.debian.org/iso-codes-team/iso-codes/-/archive/v${version}/${pname}-v${version}.tar.gz";
sha256 = "02lq602ghws423w04jsyjr92p0nmrfp59n1m5hbbi1c6fhxryghc";
sha256 = "sha256-QI95nfQTVGj6fKNetrBcQAS+pEPYHKWLibLkgkAagrs=";
};
patchPhase = ''
@@ -1,7 +1,7 @@
{ stdenv, lib, fetchurl, fetchpatch, pkg-config, libtool
, gtk2-x11, gtk3-x11 , gtkSupport ? null
, libpulseaudio, gst_all_1, libvorbis, libcap
, Carbon, CoreServices
, Carbon, CoreServices, AppKit
, withAlsa ? stdenv.isLinux, alsa-lib }:
stdenv.mkDerivation rec {
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
] ++ (with gst_all_1; [ gstreamer gst-plugins-base ])
++ lib.optional (gtkSupport == "gtk2") gtk2-x11
++ lib.optional (gtkSupport == "gtk3") gtk3-x11
++ lib.optionals stdenv.isDarwin [Carbon CoreServices]
++ lib.optionals stdenv.isDarwin [ Carbon CoreServices AppKit ]
++ lib.optional stdenv.isLinux libcap
++ lib.optional withAlsa alsa-lib;
@@ -33,15 +33,19 @@ stdenv.mkDerivation rec {
url = "http://git.0pointer.net/libcanberra.git/patch/?id=c0620e432650e81062c1967cc669829dbd29b310";
sha256 = "0rc7zwn39yxzxp37qh329g7375r5ywcqcaak8ryd0dgvg8m5hcx9";
})
] ++ lib.optionals stdenv.isDarwin [
(fetchpatch {
url = "https://github.com/macports/macports-ports/raw/5a7965dfea7727d1ceedee46c7b0ccee9cb23468/audio/libcanberra/files/patch-configure.diff";
sha256 = "sha256-pEJy1krciUEg5BFIS8FJ4BubjfS/nt9aqi6BLnS1+4M=";
extraPrefix = "";
})
(fetchpatch {
url = "https://github.com/macports/macports-ports/raw/5a7965dfea7727d1ceedee46c7b0ccee9cb23468/audio/libcanberra/files/dynamic_lookup-11.patch";
sha256 = "sha256-nUjha2pKh5VZl0ZZzcr9NTo1TVuMqF4OcLiztxW+ofQ=";
extraPrefix = "";
})
];
postPatch = lib.optionalString stdenv.isDarwin ''
patch -p0 < ${fetchpatch {
url = "https://raw.githubusercontent.com/macports/macports-ports/master/audio/libcanberra/files/patch-configure.diff";
sha256 = "1f7h7ifpqvbfhqygn1b7klvwi80zmpv3538vbmq7ql7bkf1q8h31";
}}
'';
postInstall = ''
for f in $out/lib/*.la; do
sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $f
@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "libevdev";
version = "1.12.1";
version = "1.13.0";
src = fetchurl {
url = "https://www.freedesktop.org/software/${pname}/${pname}-${version}.tar.xz";
sha256 = "sha256-HbukG8UW08p6vA2luGLv4+qKcBj6bpuXzp05QBsiQmw=";
sha256 = "sha256-nt8gBsyGpQVSeWR8OOySPRGoIe5NwsMDPo0g6O4jfNk=";
};
nativeBuildInputs = [ python3 ];
@@ -17,31 +17,15 @@
};
in stdenv.mkDerivation (rec {
pname = "libgpg-error";
version = "1.42";
version = "1.45";
src = fetchurl {
url = "mirror://gnupg/${pname}/${pname}-${version}.tar.bz2";
sha256 = "sha256-/AfnD2xhX4xPWQqON6m43S4soelAj45gRZxnRSuSXiM=";
sha256 = "sha256-Vw+O5PtL/3t0lc/5IMJ1ACrqIUfpodIgwGghMmf4CiY=";
};
# 1.42 breaks (some?) cross-compilation (e.g. x86_64 -> aarch64).
# Backporting this fix (merged in upstream master but no release cut) by David Michael <fedora.dm0@gmail.com> https://dev.gnupg.org/rE33593864cd54143db594c4237bba41e14179061c
patches = [ ./fix-1.42-cross-compilation.patch ];
postPatch = ''
sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure
'' + lib.optionalString (stdenv.hostPlatform.isAarch32 && stdenv.buildPlatform != stdenv.hostPlatform) ''
ln -s lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.linux-gnueabihf.h
ln -s lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.linux-gnueabi.h
'' + lib.optionalString (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isMusl) ''
ln -s lock-obj-pub.x86_64-pc-linux-musl.h src/syscfg/lock-obj-pub.linux-musl.h
'' + lib.optionalString (stdenv.hostPlatform.isi686 && stdenv.hostPlatform.isMusl) ''
ln -s lock-obj-pub.i686-unknown-linux-gnu.h src/syscfg/lock-obj-pub.linux-musl.h
'' + lib.optionalString (stdenv.hostPlatform.isAarch32 && stdenv.hostPlatform.isMusl) ''
ln -s lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.arm-unknown-linux-musleabihf.h
ln -s lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.linux-musleabihf.h
'' + lib.optionalString (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isMusl) ''
ln -s lock-obj-pub.aarch64-unknown-linux-gnu.h src/syscfg/lock-obj-pub.linux-musl.h
'';
outputs = [ "out" "dev" "info" ];
@@ -1,142 +0,0 @@
diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh
index a710f0c..258eec6 100755
--- a/src/gen-lock-obj.sh
+++ b/src/gen-lock-obj.sh
@@ -1,136 +1,136 @@
#! /bin/sh
#
# gen-lock-obj.sh - Build tool to construct the lock object.
#
# Copyright (C) 2020, 2021 g10 Code GmbH
#
# This file is part of libgpg-error.
#
# libgpg-error is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# libgpg-error is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <https://www.gnu.org/licenses/>.
#
#
# Following variables should be defined to invoke this script
#
# CC
# OBJDUMP
# AWK
# ac_ext
# ac_object
# host
# LOCK_ABI_VERSION
#
# An example:
#
# LOCK_ABI_VERSION=1 host=x86_64-pc-linux-gnu host_alias=x86_64-linux-gnu \
# CC=$host_alias-gcc OBJDUMP=$host_alias-objdump ac_ext=c ac_objext=o \
# AWK=gawk ./gen-lock-obj.sh
#
-if test -n `echo -n`; then
+if test -n "`echo -n`"; then
ECHO_C='\c'
ECHO_N=''
else
ECHO_C=''
ECHO_N='-n'
fi
if test "$1" = --disable-threads; then
cat <<EOF
## lock-obj-pub.$host.h - NO LOCK SUPPORT
## File created by gen-lock-obj.sh - DO NOT EDIT
## To be included by mkheader into gpg-error.h
/* Dummy object - no locking available. */
typedef struct
{
long _vers;
} gpgrt_lock_t;
#define GPGRT_LOCK_INITIALIZER {-1}
EOF
else
AWK_VERSION_OUTPUT=$($AWK 'BEGIN { print PROCINFO["version"] }')
if test -n "$AWK_VERSION_OUTPUT"; then
# It's GNU awk, which supports PROCINFO.
AWK_OPTION=--non-decimal-data
fi
cat <<'EOF' >conftest.$ac_ext
#include <pthread.h>
pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
EOF
if $CC -c conftest.$ac_ext; then :
ac_mtx_size=$($OBJDUMP -j .bss -t conftest.$ac_objext \
| $AWK $AWK_OPTION '
/mtx$/ { mtx_size = int("0x" $5) }
END { print mtx_size }')
else
echo "Can't determine mutex size"
exit 1
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cat <<EOF
## lock-obj-pub.$host.h
## File created by gen-lock-obj.sh - DO NOT EDIT
## To be included by mkheader into gpg-error.h
typedef struct
{
long _vers;
union {
volatile char _priv[$ac_mtx_size];
long _x_align;
long *_xp_align;
} u;
} gpgrt_lock_t;
EOF
# FIXME: Support different alignment conditions of:
#
# USE_16BYTE_ALIGNMENT
# USE_DOUBLE_FOR_ALIGNMENT
# USE_LONG_DOUBLE_FOR_ALIGNMENT
#
echo ${ECHO_N} "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{${ECHO_C}"
i=0
while test "$i" -lt $ac_mtx_size; do
if test "$i" -ne 0 -a "$(( $i % 8 ))" -eq 0; then
echo ' \'
echo ${ECHO_N} " ${ECHO_C}"
fi
echo ${ECHO_N} "0${ECHO_C}"
if test "$i" -lt $(($ac_mtx_size - 1)); then
echo ${ECHO_N} ",${ECHO_C}"
fi
i=$(( i + 1 ))
done
fi
cat <<'EOF'
}}}
##
## Local Variables:
## mode: c
## buffer-read-only: t
## End:
##
EOF
exit 0
@@ -23,16 +23,21 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ninja ];
checkInputs = [ gtest ];
# Required for case-insensitive filesystems ("BUILD" exists)
dontUseCmakeBuildDir = true;
cmakeFlags = [
cmakeFlags = let
libExt = stdenv.hostPlatform.extensions.library;
in [
"-GNinja"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optional doCheck "-DHWY_SYSTEM_GTEST:BOOL=ON";
] ++ lib.optionals doCheck [
"-DHWY_SYSTEM_GTEST:BOOL=ON"
"-DGTEST_INCLUDE_DIR=${lib.getDev gtest}/include"
"-DGTEST_LIBRARY=${lib.getLib gtest}/lib/libgtest${libExt}"
"-DGTEST_MAIN_LIBRARY=${lib.getLib gtest}/lib/libgtest_main${libExt}"
];
# hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408
doCheck = !stdenv.hostPlatform.isDarwin;
@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "libidn";
version = "1.38";
version = "1.41";
src = fetchurl {
url = "mirror://gnu/libidn/${pname}-${version}.tar.gz";
sha256 = "sha256-3gC4QPdXzTuxTdmiDVk2RzI13cugbUvC2oBGVLi78PY=";
sha256 = "sha256-iE1wY2S4Gr3Re+6Whtj/KudDHFoUZRBHxorfizH9iUU=";
};
outputs = [ "bin" "dev" "out" "info" "devdoc" ];
@@ -31,13 +31,13 @@ assert !(enableJpeg7 && enableJpeg8); # pick only one or none, not both
stdenv.mkDerivation rec {
pname = "libjpeg-turbo";
version = "2.1.3";
version = "2.1.4";
src = fetchFromGitHub {
owner = "libjpeg-turbo";
repo = "libjpeg-turbo";
rev = version;
sha256 = "sha256-GbOYoCNAsOESXrEsBb6OHVB4TKhPUEU04PBp8qXVMug=";
sha256 = "sha256-1NRoVIL3zXX1D6iOf2FCrwBEcDW7TYFbdIbCTjY1m8Q=";
};
# This is needed by freeimage
@@ -23,6 +23,8 @@ stdenv.mkDerivation rec {
pname = "libjxl";
version = "0.6.1";
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "libjxl";
repo = "libjxl";
@@ -67,11 +69,14 @@ stdenv.mkDerivation rec {
pkg-config
] ++ lib.optionals buildDocs [
asciidoc
graphviz
doxygen
python3
];
depsBuildBuild = lib.optionals buildDocs [
graphviz
];
# Functionality not currently provided by this package
# that the cmake build can apparently use:
# OpenGL/GLUT (for Examples -> comparison with sjpeg)
@@ -123,6 +128,8 @@ stdenv.mkDerivation rec {
# * the `gdk-pixbuf` one, which allows applications like `eog` to load jpeg-xl files
# * the `gimp` one, which allows GIMP to load jpeg-xl files
# "-DJPEGXL_ENABLE_PLUGINS=ON"
] ++ lib.optionals stdenv.hostPlatform.isStatic [
"-DJPEGXL_STATIC=ON"
];
LDFLAGS = lib.optionalString stdenv.hostPlatform.isRiscV "-latomic";
@@ -4,6 +4,8 @@ stdenv.mkDerivation rec {
pname = "liblqr-1";
version = "0.4.2";
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "carlobaldassi";
repo = "liblqr";
@@ -1,12 +1,12 @@
{ lib, stdenv, fetchurl, pkg-config, libmnl }:
stdenv.mkDerivation rec {
version = "1.2.2";
version = "1.2.3";
pname = "libnftnl";
src = fetchurl {
url = "https://netfilter.org/projects/${pname}/files/${pname}-${version}.tar.bz2";
hash = "sha256-nvwAT50VkY1o+emOGU1V4DAWjzO7Z8PnpUW3QMntbQo=";
hash = "sha256-6Rbqm3n5UYVguaGHJRp8BCRCqey85/Nr55CIiGBdAlU=";
};
nativeBuildInputs = [ pkg-config ];
@@ -56,13 +56,13 @@ assert isCygwin -> unitTestsSupport && webmIOSupport && libyuvSupport;
stdenv.mkDerivation rec {
pname = "libvpx";
version = "1.11.0";
version = "1.12.0";
src = fetchFromGitHub {
owner = "webmproject";
repo = pname;
rev = "v${version}";
sha256 = "00f1jrclai2b6ys78dpsg6r1mvcyxlna93vxcz8zjyia24c2pjsb";
sha256 = "sha256-9SFFE2GfYYMgxp1dpmL3STTU2ea1R5vFKA1L0pZwIvQ=";
};
postPatch = ''
@@ -27,17 +27,15 @@
stdenv.mkDerivation rec {
pname = "libwebp";
version = "1.2.3";
version = "1.2.4";
src = fetchFromGitHub {
owner = "webmproject";
repo = pname;
rev = "v${version}";
hash = "sha256-t27d+eJR4iTHSLlI3J7RqHgsWACThjsI9O6R2Zb9F1g=";
hash = "sha256-XX6qOWlIl8TqOQMiGpmmDVKwQnM1taG6lrqq1ZFVk5s=";
};
prePatch = "patchShebangs .";
configureFlags = [
(lib.enableFeature threadingSupport "threading")
(lib.enableFeature openglSupport "gl")
+8 -8
View File
@@ -34,8 +34,7 @@ with lib;
let
# Release calendar: https://www.mesa3d.org/release-calendar.html
# Release frequency: https://www.mesa3d.org/releasing.html#schedule
# 22.1 on darwin won't build: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6519
version = if stdenv.isDarwin then "22.0.4" else "22.1.4";
version = "22.1.6";
branch = versions.major version;
self = stdenv.mkDerivation {
@@ -49,10 +48,7 @@ self = stdenv.mkDerivation {
"ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz"
"ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
];
sha256 = {
"22.1.4" = "0xhbcjqy3g5dfxhr4flmqncmsjnwljfqm9idx92jm43jifz8q3b7";
"22.0.4" = "1m0y8wgy48hmcidsr7sbk5hcw3v0qr8359fd2x34fvl2z9c1z5y7";
}.${version};
sha256 = "22ced061eb9adab8ea35368246c1995c09723f3f71653cd5050c5cec376e671a";
};
# TODO:
@@ -63,11 +59,11 @@ self = stdenv.mkDerivation {
./musl.patch
(fetchpatch {
url = "https://raw.githubusercontent.com/void-linux/void-packages/b9f58f303ae23754c95d5d1fe87a98b5a2d8f271/srcpkgs/mesa/patches/musl-endian.patch";
sha256 = "sha256-eRc91qCaFlVzrxFrNUPpAHd1gsqKsLCCN0IW8pBQcqk=";
hash = "sha256-eRc91qCaFlVzrxFrNUPpAHd1gsqKsLCCN0IW8pBQcqk=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/void-linux/void-packages/b9f58f303ae23754c95d5d1fe87a98b5a2d8f271/srcpkgs/mesa/patches/musl-stacksize.patch";
sha256 = "sha256-bEp0AWddsw1Pc3rxdKN8fsrX4x2TQEzMUa5afhLXGsg=";
hash = "sha256-bEp0AWddsw1Pc3rxdKN8fsrX4x2TQEzMUa5afhLXGsg=";
})
./opencl.patch
@@ -76,6 +72,10 @@ self = stdenv.mkDerivation {
# Fix aarch64-darwin build, remove when upstreaam supports it out of the box.
# See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1020
./aarch64-darwin.patch
] ++ optionals stdenv.isDarwin [
# 22.1 on darwin won't build: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6519
# (already in-tree for 22.2)
./drop-dri2.patch
];
postPatch = ''
@@ -0,0 +1,40 @@
diff --git a/a/src/gallium/frontends/dri/dri_util.c b/b/src/gallium/frontends/dri/dri_util.c
index 8d60526..782360d 100644
--- a/src/gallium/frontends/dri/dri_util.c
+++ b/src/gallium/frontends/dri/dri_util.c
@@ -808,35 +808,6 @@ const __DRIcoreExtension driCoreExtension = {
.unbindContext = driUnbindContext
};
-/** DRI2 interface */
-const __DRIdri2Extension driDRI2Extension = {
- .base = { __DRI_DRI2, 4 },
-
- .createNewScreen = dri2CreateNewScreen,
- .createNewDrawable = driCreateNewDrawable,
- .createNewContext = driCreateNewContext,
- .getAPIMask = driGetAPIMask,
- .createNewContextForAPI = driCreateNewContextForAPI,
- .allocateBuffer = dri2AllocateBuffer,
- .releaseBuffer = dri2ReleaseBuffer,
- .createContextAttribs = driCreateContextAttribs,
- .createNewScreen2 = driCreateNewScreen2,
-};
-
-const __DRIdri2Extension swkmsDRI2Extension = {
- .base = { __DRI_DRI2, 4 },
-
- .createNewScreen = swkmsCreateNewScreen,
- .createNewDrawable = driCreateNewDrawable,
- .createNewContext = driCreateNewContext,
- .getAPIMask = driGetAPIMask,
- .createNewContextForAPI = driCreateNewContextForAPI,
- .allocateBuffer = dri2AllocateBuffer,
- .releaseBuffer = dri2ReleaseBuffer,
- .createContextAttribs = driCreateContextAttribs,
- .createNewScreen2 = driCreateNewScreen2,
-};
-
const __DRIswrastExtension driSWRastExtension = {
.base = { __DRI_SWRAST, 4 },
+3 -7
View File
@@ -27,14 +27,10 @@ stdenv.mkDerivation rec {
done
'';
nativeBuildInputs = [
cmake
];
cmakeFlags = lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";
propagatedBuildInputs = [
imath
zlib
];
nativeBuildInputs = [ cmake ];
propagatedBuildInputs = [ imath zlib ];
doCheck = true;
@@ -9,7 +9,7 @@
stdenv.mkDerivation rec {
pname = "openexr";
version = "2.5.7";
version = "2.5.8";
outputs = [ "bin" "dev" "out" "doc" ];
@@ -17,15 +17,10 @@ stdenv.mkDerivation rec {
owner = "AcademySoftwareFoundation";
repo = "openexr";
rev = "v${version}";
sha256 = "1vja0rbilcd1wn184w8nbcmck00n7bfwlddwiaxw8dhj64nx4468";
sha256 = "sha256-N7XdDaDsYdx4TXvHplQDTvhHNUmW5rntdaTKua4C0es=";
};
patches = [
# Fix pkg-config paths
(fetchpatch {
url = "https://github.com/AcademySoftwareFoundation/openexr/commit/2f19a01923885fda75ec9d19332de080ec7102bd.patch";
sha256 = "1yxmrdzq1x1911wdzwnzr29jmg2r4wd4yx3vhjn0y5dpny0ri5y5";
})
(fetchpatch {
name = "CVE-2021-45942.patch";
url = "https://github.com/AcademySoftwareFoundation/openexr/commit/11cad77da87c4fa2aab7d58dd5339e254db7937e.patch";
@@ -35,6 +30,8 @@ stdenv.mkDerivation rec {
})
];
cmakeFlags = lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";
nativeBuildInputs = [ cmake ];
propagatedBuildInputs = [ ilmbase zlib ];
@@ -57,14 +57,13 @@ stdenv.mkDerivation rec {
url = "https://gitlab.freedesktop.org/polkit/polkit/-/commit/7ba07551dfcd4ef9a87b8f0d9eb8b91fabcb41b3.patch";
sha256 = "ebbLILncq1hAZTBMsLm+vDGw6j0iQ0crGyhzyLZQgKA=";
})
] ++ lib.optionals stdenv.hostPlatform.isMusl [
# Make netgroup support optional (musl does not have it)
# Upstream MR: https://gitlab.freedesktop.org/polkit/polkit/merge_requests/10
# We use the version of the patch that Alpine uses successfully.
# NOTE: Remove after the next release
(fetchpatch {
name = "make-innetgr-optional.patch";
url = "https://git.alpinelinux.org/aports/plain/community/polkit/make-innetgr-optional.patch?id=424ecbb6e9e3a215c978b58c05e5c112d88dddfc";
sha256 = "0iyiksqk29sizwaa4623bv683px1fny67639qpb1him89hza00wy";
url = "https://gitlab.freedesktop.org/polkit/polkit/-/commit/b57deee8178190a7ecc75290fa13cf7daabc2c66.patch";
sha256 = "8te6gatT9Fp+fIT05fQBym5mEwHeHfaUNUNEMfSbtLc=";
})
];
@@ -153,7 +152,7 @@ stdenv.mkDerivation rec {
--replace /bin/false ${coreutils}/bin/false
'';
postConfigure = ''
postConfigure = lib.optionalString (!stdenv.hostPlatform.isMusl) ''
# Unpacked by meson
chmod +x subprojects/mocklibc-1.0/bin/mocklibc
patchShebangs subprojects/mocklibc-1.0/bin/mocklibc
+18 -6
View File
@@ -5,21 +5,20 @@
, pcre
, readline
, zlib
, writeScript
}:
stdenv.mkDerivation rec {
pname = "slang";
version = "2.3.2";
version = "2.3.3";
src = fetchurl {
url = "https://www.jedsoft.org/releases/slang/${pname}-${version}.tar.bz2";
sha256 = "sha256-/J47D8T2fDwfbUPJDBalxC0Re44oRXxbRoMbi1064xo=";
sha256 = "sha256-+RRQVK4TGXPGEgjqgkhtXdEOPFza0jt8SgYXdDyPWhg=";
};
outputs = [ "out" "dev" "man" "doc" ];
patches = [ ./terminfo-dirs.patch ];
# Fix some wrong hardcoded paths
preConfigure = ''
sed -ie "s|/usr/lib/terminfo|${ncurses.out}/lib/terminfo|" configure
@@ -51,14 +50,27 @@ stdenv.mkDerivation rec {
makeFlagsArray+=(AR_CR="${stdenv.cc.targetPrefix}ar cr")
'';
# slang 2.3.2 does not support parallel building
enableParallelBuilding = false;
enableParallelBuilding = true;
postInstall = ''
find "$out"/lib/ -name '*.so' -exec chmod +x "{}" \;
sed '/^Libs:/s/$/ -lncurses/' -i "$dev"/lib/pkgconfig/slang.pc
'';
passthru = {
updateScript = writeScript "update-slang" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl pcre common-updater-scripts
set -eu -o pipefail
# Expect the text in format of 'Version 2.3.3</td>'
new_version="$(curl -s https://www.jedsoft.org/slang/ |
pcregrep -o1 'Version ([0-9.]+)</td>')"
update-source-version ${pname} "$new_version"
'';
};
meta = with lib; {
description = "A small, embeddable multi-platform programming library";
longDescription = ''
@@ -1,172 +0,0 @@
commit c7aa0c07b6522fbbb47ef47bd22f47f1611e7423
Author: John E. Davis <jed@jedsoft.org>
Date: Wed Nov 28 00:46:28 2018 -0500
pre2.3.3-5: Added support for TERMINFO_DIRS env var
Modified: removed changes to changelog and version number.
diff --git a/src/sltermin.c b/src/sltermin.c
index a06d0e4..65d3bbc 100644
--- a/src/sltermin.c
+++ b/src/sltermin.c
@@ -133,6 +133,9 @@ static FILE *open_terminfo (char *file, SLterminfo_Type *h)
unsigned char buf[12];
int magic;
+#ifdef SLANG_UNTIC
+ (void) fprintf (stdout,"# Trying %s\n", file);
+#endif
/* Alan Cox reported a security problem here if the application using the
* library is setuid. So, I need to make sure open the file as a normal
* user. Unfortunately, there does not appear to be a portable way of
@@ -269,10 +272,73 @@ static char *read_string_table (FILE *fp, SLterminfo_Type *t)
* are implemented by multiple links to the same compiled file.
*/
+static FILE *try_open_tidir (SLterminfo_Type *ti, const char *tidir, const char *term)
+{
+ char file[1024];
+
+ if (sizeof (file) > strlen (tidir) + 5 + strlen (term))
+ {
+ FILE *fp;
+
+ sprintf (file, "%s/%c/%s", tidir, *term, term);
+ if (NULL != (fp = open_terminfo (file, ti)))
+ return fp;
+
+ sprintf (file, "%s/%02x/%s", tidir, (unsigned char)*term, term);
+ if (NULL != (fp = open_terminfo (file, ti)))
+ return fp;
+ }
+
+ return NULL;
+}
+
+static FILE *try_open_env (SLterminfo_Type *ti, const char *term, const char *envvar)
+{
+ char *tidir;
+
+ if (NULL == (tidir = _pSLsecure_getenv (envvar)))
+ return NULL;
+
+ return try_open_tidir (ti, tidir, term);
+}
+
+static FILE *try_open_home (SLterminfo_Type *ti, const char *term)
+{
+ char home_ti[1024];
+ char *env;
+
+ if (NULL == (env = _pSLsecure_getenv ("HOME")))
+ return NULL;
+
+ strncpy (home_ti, env, sizeof (home_ti) - 11);
+ home_ti [sizeof(home_ti) - 11] = 0;
+ strcat (home_ti, "/.terminfo");
+
+ return try_open_tidir (ti, home_ti, term);
+}
+
+static FILE *try_open_env_path (SLterminfo_Type *ti, const char *term, const char *envvar)
+{
+ char tidir[1024];
+ char *env;
+ unsigned int i;
+
+ if (NULL == (env = _pSLsecure_getenv (envvar)))
+ return NULL;
+
+ i = 0;
+ while (-1 != SLextract_list_element (env, i, ':', tidir, sizeof(tidir)))
+ {
+ FILE *fp = try_open_tidir (ti, tidir, term);
+ if (fp != NULL) return fp;
+ i++;
+ }
+
+ return NULL;
+}
+
static SLCONST char *Terminfo_Dirs [] =
{
- "", /* $TERMINFO */
- "", /* $HOME/.terminfo */
#ifdef MISC_TERMINFO_DIRS
MISC_TERMINFO_DIRS,
#endif
@@ -287,6 +353,23 @@ static SLCONST char *Terminfo_Dirs [] =
NULL,
};
+static FILE *try_open_hardcoded (SLterminfo_Type *ti, const char *term)
+{
+ const char *tidir, **tidirs;
+
+ tidirs = Terminfo_Dirs;
+ while (NULL != (tidir = *tidirs++))
+ {
+ FILE *fp;
+
+ if ((*tidir != 0)
+ && (NULL != (fp = try_open_tidir (ti, tidir, term))))
+ return fp;
+ }
+
+ return NULL;
+}
+
void _pSLtt_tifreeent (SLterminfo_Type *t)
{
if (t == NULL)
@@ -305,11 +388,7 @@ void _pSLtt_tifreeent (SLterminfo_Type *t)
SLterminfo_Type *_pSLtt_tigetent (SLCONST char *term)
{
- SLCONST char **tidirs, *tidir;
FILE *fp = NULL;
- char file[1024];
- static char home_ti [1024];
- char *env;
SLterminfo_Type *ti;
if (
@@ -341,33 +420,10 @@ SLterminfo_Type *_pSLtt_tigetent (SLCONST char *term)
/* If we are on a termcap based system, use termcap */
if (0 == tcap_getent (term, ti)) return ti;
- if (NULL != (env = _pSLsecure_getenv ("TERMINFO")))
- Terminfo_Dirs[0] = env;
-
- if (NULL != (env = _pSLsecure_getenv ("HOME")))
- {
- strncpy (home_ti, env, sizeof (home_ti) - 11);
- home_ti [sizeof(home_ti) - 11] = 0;
- strcat (home_ti, "/.terminfo");
- Terminfo_Dirs [1] = home_ti;
- }
-
- tidirs = Terminfo_Dirs;
- while (NULL != (tidir = *tidirs++))
- {
- if (*tidir == 0)
- continue;
-
- if (sizeof (file) > strlen (tidir) + 5 + strlen (term))
- {
- sprintf (file, "%s/%c/%s", tidir, *term, term);
- if (NULL != (fp = open_terminfo (file, ti)))
- break;
- sprintf (file, "%s/%02x/%s", tidir, (unsigned char)*term, term);
- if (NULL != (fp = open_terminfo (file, ti)))
- break;
- }
- }
+ fp = try_open_env_path (ti, term, "TERMINFO_DIRS");
+ if (fp == NULL) fp = try_open_env (ti, term, "TERMINFO");
+ if (fp == NULL) fp = try_open_home (ti, term);
+ if (fp == NULL) fp = try_open_hardcoded (ti, term);
#ifdef SLANG_UNTIC
fp_open_label:
@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "speexdsp";
version = "1.2.0";
version = "1.2.1";
src = fetchurl {
url = "https://downloads.xiph.org/releases/speex/${pname}-${version}.tar.gz";
sha256 = "0wa7sqpk3x61zz99m7lwkgr6yv62ml6lfgs5xja65vlvdzy44838";
sha256 = "sha256-jHdzQ+SmOZVpxyq8OKlbJNtWiCyD29tsZCSl9K61TT0=";
};
patches = [ ./build-fix.patch ];
@@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "spirv-headers";
version = "1.3.211.0";
version = "1.3.216.0";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Headers";
rev = "sdk-${version}";
sha256 = "sha256-LkIrTFWYvZffLVJJW3152um5LTEsMJEDEsIhBAdhBlk=";
hash = "sha256-qYhFoRrQOlvYvVXhIFsa3dZuORDpZyVC5peeYmGNimw=";
};
nativeBuildInputs = [ cmake ];
@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "libtirpc";
version = "1.2.7-rc4";
version = "1.3.3";
src = fetchurl {
url = "http://git.linux-nfs.org/?p=steved/libtirpc.git;a=snapshot;h=5ca4ca92f629d9d83e83544b9239abaaacf0a527;sf=tgz";
sha256 = "0w26yf9bwkpqj52sqd3n250dg9jlqnr8bjv0kc4fl5hkrv8akj8i";
url = "http://git.linux-nfs.org/?p=steved/libtirpc.git;a=snapshot;h=0fb94eef5062d2657d75eee686fa47238fafa312;sf=tgz";
sha256 = "sha256-3P3xYKeAmLbBI4TdsG1VZBO7py9ktiwhXNtGsnryGNI=";
name = "${pname}-${version}.tar.gz";
};
@@ -1,7 +1,7 @@
{ lib, stdenv, fetchFromGitHub, cmake }:
stdenv.mkDerivation rec {
pname = "vulkan-headers";
version = "1.3.211.0";
version = "1.3.216.0";
nativeBuildInputs = [ cmake ];
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
owner = "KhronosGroup";
repo = "Vulkan-Headers";
rev = "sdk-${version}";
sha256 = "sha256-FqrcFHsUS8e4ZgZpxVc8nNZWdNltniFmMjyyWVoNc7w=";
hash = "sha256-jHzW3m9smuzEGbZrSyBI74K9rFozxiG3M5Xql/WOw7U=";
};
meta = with lib; {
@@ -3,14 +3,14 @@
stdenv.mkDerivation rec {
pname = "vulkan-loader";
version = "1.3.211.0";
version = "1.3.216.0";
src = (assert version == vulkan-headers.version;
fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-Loader";
rev = "sdk-${version}";
sha256 = "sha256-NQu98wA7UK231rpoKDs1yQ6pEyB4wZg7MjFC3JwS2BY=";
hash = "sha256-EcsJzY/R9rreWvYTgoxHNloR5n2xaR/0rouDJVAGaxs=";
});
patches = [ ./fix-pkgconfig.patch ];
@@ -1,346 +0,0 @@
From 5c44459c3b28a9bd3283aaceab7c615f8020c531 Mon Sep 17 00:00:00 2001
From: Mark Adler <madler@alumni.caltech.edu>
Date: Tue, 17 Apr 2018 22:09:22 -0700
Subject: [PATCH 1/2] Fix a bug that can crash deflate on some input when using
Z_FIXED.
This bug was reported by Danilo Ramos of Eideticom, Inc. It has
lain in wait 13 years before being found! The bug was introduced
in zlib 1.2.2.2, with the addition of the Z_FIXED option. That
option forces the use of fixed Huffman codes. For rare inputs with
a large number of distant matches, the pending buffer into which
the compressed data is written can overwrite the distance symbol
table which it overlays. That results in corrupted output due to
invalid distances, and can result in out-of-bound accesses,
crashing the application.
The fix here combines the distance buffer and literal/length
buffers into a single symbol buffer. Now three bytes of pending
buffer space are opened up for each literal or length/distance
pair consumed, instead of the previous two bytes. This assures
that the pending buffer cannot overwrite the symbol table, since
the maximum fixed code compressed length/distance is 31 bits, and
since there are four bytes of pending space for every three bytes
of symbol space.
---
deflate.c | 74 ++++++++++++++++++++++++++++++++++++++++---------------
deflate.h | 25 +++++++++----------
trees.c | 50 +++++++++++--------------------------
3 files changed, 79 insertions(+), 70 deletions(-)
diff --git a/deflate.c b/deflate.c
index 425babc..19cba87 100644
--- a/deflate.c
+++ b/deflate.c
@@ -255,11 +255,6 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
int wrap = 1;
static const char my_version[] = ZLIB_VERSION;
- ushf *overlay;
- /* We overlay pending_buf and d_buf+l_buf. This works since the average
- * output size for (length,distance) codes is <= 24 bits.
- */
-
if (version == Z_NULL || version[0] != my_version[0] ||
stream_size != sizeof(z_stream)) {
return Z_VERSION_ERROR;
@@ -329,9 +324,47 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
- overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
- s->pending_buf = (uchf *) overlay;
- s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
+ /* We overlay pending_buf and sym_buf. This works since the average size
+ * for length/distance pairs over any compressed block is assured to be 31
+ * bits or less.
+ *
+ * Analysis: The longest fixed codes are a length code of 8 bits plus 5
+ * extra bits, for lengths 131 to 257. The longest fixed distance codes are
+ * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest
+ * possible fixed-codes length/distance pair is then 31 bits total.
+ *
+ * sym_buf starts one-fourth of the way into pending_buf. So there are
+ * three bytes in sym_buf for every four bytes in pending_buf. Each symbol
+ * in sym_buf is three bytes -- two for the distance and one for the
+ * literal/length. As each symbol is consumed, the pointer to the next
+ * sym_buf value to read moves forward three bytes. From that symbol, up to
+ * 31 bits are written to pending_buf. The closest the written pending_buf
+ * bits gets to the next sym_buf symbol to read is just before the last
+ * code is written. At that time, 31*(n-2) bits have been written, just
+ * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at
+ * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1
+ * symbols are written.) The closest the writing gets to what is unread is
+ * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and
+ * can range from 128 to 32768.
+ *
+ * Therefore, at a minimum, there are 142 bits of space between what is
+ * written and what is read in the overlain buffers, so the symbols cannot
+ * be overwritten by the compressed data. That space is actually 139 bits,
+ * due to the three-bit fixed-code block header.
+ *
+ * That covers the case where either Z_FIXED is specified, forcing fixed
+ * codes, or when the use of fixed codes is chosen, because that choice
+ * results in a smaller compressed block than dynamic codes. That latter
+ * condition then assures that the above analysis also covers all dynamic
+ * blocks. A dynamic-code block will only be chosen to be emitted if it has
+ * fewer bits than a fixed-code block would for the same set of symbols.
+ * Therefore its average symbol length is assured to be less than 31. So
+ * the compressed data for a dynamic block also cannot overwrite the
+ * symbols from which it is being constructed.
+ */
+
+ s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4);
+ s->pending_buf_size = (ulg)s->lit_bufsize * 4;
if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
s->pending_buf == Z_NULL) {
@@ -340,8 +373,12 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
deflateEnd (strm);
return Z_MEM_ERROR;
}
- s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
- s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
+ s->sym_buf = s->pending_buf + s->lit_bufsize;
+ s->sym_end = (s->lit_bufsize - 1) * 3;
+ /* We avoid equality with lit_bufsize*3 because of wraparound at 64K
+ * on 16 bit machines and because stored blocks are restricted to
+ * 64K-1 bytes.
+ */
s->level = level;
s->strategy = strategy;
@@ -552,7 +589,7 @@ int ZEXPORT deflatePrime (strm, bits, value)
if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
s = strm->state;
- if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
+ if (s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
return Z_BUF_ERROR;
do {
put = Buf_size - s->bi_valid;
@@ -1113,7 +1150,6 @@ int ZEXPORT deflateCopy (dest, source)
#else
deflate_state *ds;
deflate_state *ss;
- ushf *overlay;
if (deflateStateCheck(source) || dest == Z_NULL) {
@@ -1133,8 +1169,7 @@ int ZEXPORT deflateCopy (dest, source)
ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
- overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
- ds->pending_buf = (uchf *) overlay;
+ ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4);
if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
ds->pending_buf == Z_NULL) {
@@ -1148,8 +1183,7 @@ int ZEXPORT deflateCopy (dest, source)
zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
- ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
- ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
+ ds->sym_buf = ds->pending_buf + ds->lit_bufsize;
ds->l_desc.dyn_tree = ds->dyn_ltree;
ds->d_desc.dyn_tree = ds->dyn_dtree;
@@ -1925,7 +1959,7 @@ local block_state deflate_fast(s, flush)
FLUSH_BLOCK(s, 1);
return finish_done;
}
- if (s->last_lit)
+ if (s->sym_next)
FLUSH_BLOCK(s, 0);
return block_done;
}
@@ -2056,7 +2090,7 @@ local block_state deflate_slow(s, flush)
FLUSH_BLOCK(s, 1);
return finish_done;
}
- if (s->last_lit)
+ if (s->sym_next)
FLUSH_BLOCK(s, 0);
return block_done;
}
@@ -2131,7 +2165,7 @@ local block_state deflate_rle(s, flush)
FLUSH_BLOCK(s, 1);
return finish_done;
}
- if (s->last_lit)
+ if (s->sym_next)
FLUSH_BLOCK(s, 0);
return block_done;
}
@@ -2170,7 +2204,7 @@ local block_state deflate_huff(s, flush)
FLUSH_BLOCK(s, 1);
return finish_done;
}
- if (s->last_lit)
+ if (s->sym_next)
FLUSH_BLOCK(s, 0);
return block_done;
}
diff --git a/deflate.h b/deflate.h
index 23ecdd3..d4cf1a9 100644
--- a/deflate.h
+++ b/deflate.h
@@ -217,7 +217,7 @@ typedef struct internal_state {
/* Depth of each subtree used as tie breaker for trees of equal frequency
*/
- uchf *l_buf; /* buffer for literals or lengths */
+ uchf *sym_buf; /* buffer for distances and literals/lengths */
uInt lit_bufsize;
/* Size of match buffer for literals/lengths. There are 4 reasons for
@@ -239,13 +239,8 @@ typedef struct internal_state {
* - I can't count above 4
*/
- uInt last_lit; /* running index in l_buf */
-
- ushf *d_buf;
- /* Buffer for distances. To simplify the code, d_buf and l_buf have
- * the same number of elements. To use different lengths, an extra flag
- * array would be necessary.
- */
+ uInt sym_next; /* running index in sym_buf */
+ uInt sym_end; /* symbol table full when sym_next reaches this */
ulg opt_len; /* bit length of current block with optimal trees */
ulg static_len; /* bit length of current block with static trees */
@@ -325,20 +320,22 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
# define _tr_tally_lit(s, c, flush) \
{ uch cc = (c); \
- s->d_buf[s->last_lit] = 0; \
- s->l_buf[s->last_lit++] = cc; \
+ s->sym_buf[s->sym_next++] = 0; \
+ s->sym_buf[s->sym_next++] = 0; \
+ s->sym_buf[s->sym_next++] = cc; \
s->dyn_ltree[cc].Freq++; \
- flush = (s->last_lit == s->lit_bufsize-1); \
+ flush = (s->sym_next == s->sym_end); \
}
# define _tr_tally_dist(s, distance, length, flush) \
{ uch len = (uch)(length); \
ush dist = (ush)(distance); \
- s->d_buf[s->last_lit] = dist; \
- s->l_buf[s->last_lit++] = len; \
+ s->sym_buf[s->sym_next++] = dist; \
+ s->sym_buf[s->sym_next++] = dist >> 8; \
+ s->sym_buf[s->sym_next++] = len; \
dist--; \
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
s->dyn_dtree[d_code(dist)].Freq++; \
- flush = (s->last_lit == s->lit_bufsize-1); \
+ flush = (s->sym_next == s->sym_end); \
}
#else
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
diff --git a/trees.c b/trees.c
index 4f4a650..decaeb7 100644
--- a/trees.c
+++ b/trees.c
@@ -416,7 +416,7 @@ local void init_block(s)
s->dyn_ltree[END_BLOCK].Freq = 1;
s->opt_len = s->static_len = 0L;
- s->last_lit = s->matches = 0;
+ s->sym_next = s->matches = 0;
}
#define SMALLEST 1
@@ -948,7 +948,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
- s->last_lit));
+ s->sym_next / 3));
if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
@@ -1017,8 +1017,9 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
unsigned dist; /* distance of matched string */
unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
- s->d_buf[s->last_lit] = (ush)dist;
- s->l_buf[s->last_lit++] = (uch)lc;
+ s->sym_buf[s->sym_next++] = dist;
+ s->sym_buf[s->sym_next++] = dist >> 8;
+ s->sym_buf[s->sym_next++] = lc;
if (dist == 0) {
/* lc is the unmatched char */
s->dyn_ltree[lc].Freq++;
@@ -1033,30 +1034,7 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
s->dyn_dtree[d_code(dist)].Freq++;
}
-
-#ifdef TRUNCATE_BLOCK
- /* Try to guess if it is profitable to stop the current block here */
- if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
- /* Compute an upper bound for the compressed length */
- ulg out_length = (ulg)s->last_lit*8L;
- ulg in_length = (ulg)((long)s->strstart - s->block_start);
- int dcode;
- for (dcode = 0; dcode < D_CODES; dcode++) {
- out_length += (ulg)s->dyn_dtree[dcode].Freq *
- (5L+extra_dbits[dcode]);
- }
- out_length >>= 3;
- Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
- s->last_lit, in_length, out_length,
- 100L - out_length*100L/in_length));
- if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
- }
-#endif
- return (s->last_lit == s->lit_bufsize-1);
- /* We avoid equality with lit_bufsize because of wraparound at 64K
- * on 16 bit machines and because stored blocks are restricted to
- * 64K-1 bytes.
- */
+ return (s->sym_next == s->sym_end);
}
/* ===========================================================================
@@ -1069,13 +1047,14 @@ local void compress_block(s, ltree, dtree)
{
unsigned dist; /* distance of matched string */
int lc; /* match length or unmatched char (if dist == 0) */
- unsigned lx = 0; /* running index in l_buf */
+ unsigned sx = 0; /* running index in sym_buf */
unsigned code; /* the code to send */
int extra; /* number of extra bits to send */
- if (s->last_lit != 0) do {
- dist = s->d_buf[lx];
- lc = s->l_buf[lx++];
+ if (s->sym_next != 0) do {
+ dist = s->sym_buf[sx++] & 0xff;
+ dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
+ lc = s->sym_buf[sx++];
if (dist == 0) {
send_code(s, lc, ltree); /* send a literal byte */
Tracecv(isgraph(lc), (stderr," '%c' ", lc));
@@ -1100,11 +1079,10 @@ local void compress_block(s, ltree, dtree)
}
} /* literal or match pair ? */
- /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
- Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
- "pendingBuf overflow");
+ /* Check that the overlay between pending_buf and sym_buf is ok: */
+ Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
- } while (lx < s->last_lit);
+ } while (sx < s->sym_next);
send_code(s, END_BLOCK, ltree);
}
--
2.33.1
@@ -1,27 +0,0 @@
From 4346a16853e19b45787ce933666026903fb8f3f8 Mon Sep 17 00:00:00 2001
From: Mark Adler <madler@alumni.caltech.edu>
Date: Tue, 17 Apr 2018 22:44:41 -0700
Subject: [PATCH 2/2] Assure that the number of bits for deflatePrime() is
valid.
---
deflate.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/deflate.c b/deflate.c
index 19cba87..23aef18 100644
--- a/deflate.c
+++ b/deflate.c
@@ -589,7 +589,8 @@ int ZEXPORT deflatePrime (strm, bits, value)
if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
s = strm->state;
- if (s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
+ if (bits < 0 || bits > 16 ||
+ s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
return Z_BUF_ERROR;
do {
put = Buf_size - s->bi_valid;
--
2.33.1
@@ -0,0 +1,62 @@
From eff308af425b67093bab25f80f1ae950166bece1 Mon Sep 17 00:00:00 2001
From: Mark Adler <fork@madler.net>
Date: Sat, 30 Jul 2022 15:51:11 -0700
Subject: [PATCH] Fix a bug when getting a gzip header extra field with
inflate().
If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided space is not
exceeded.
---
inflate.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/inflate.c b/inflate.c
index 7be8c6366..7a7289749 100644
--- a/inflate.c
+++ b/inflate.c
@@ -763,9 +763,10 @@ int flush;
copy = state->length;
if (copy > have) copy = have;
if (copy) {
+ len = state->head->extra_len - state->length;
if (state->head != Z_NULL &&
- state->head->extra != Z_NULL) {
- len = state->head->extra_len - state->length;
+ state->head->extra != Z_NULL &&
+ len < state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);
From 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Mon Sep 17 00:00:00 2001
From: Mark Adler <fork@madler.net>
Date: Mon, 8 Aug 2022 10:50:09 -0700
Subject: [PATCH] Fix extra field processing bug that dereferences NULL
state->head.
The recent commit to fix a gzip header extra field processing bug
introduced the new bug fixed here.
---
inflate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/inflate.c b/inflate.c
index 7a7289749..2a3c4fe98 100644
--- a/inflate.c
+++ b/inflate.c
@@ -763,10 +763,10 @@ int flush;
copy = state->length;
if (copy > have) copy = have;
if (copy) {
- len = state->head->extra_len - state->length;
if (state->head != Z_NULL &&
state->head->extra != Z_NULL &&
- len < state->head->extra_max) {
+ (len = state->head->extra_len - state->length) <
+ state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);

Some files were not shown because too many files have changed in this diff Show More