diff --git a/doc/hooks/versionCheckHook.section.md b/doc/hooks/versionCheckHook.section.md index 16b1ee97e890..9bc2aea293e6 100644 --- a/doc/hooks/versionCheckHook.section.md +++ b/doc/hooks/versionCheckHook.section.md @@ -33,6 +33,7 @@ The variables that this phase control are: - `dontVersionCheck`: Disable adding this hook to the [`preInstallCheckHooks`](#ssec-installCheck-phase). Useful if you do want to load the bash functions of the hook, but run them differently. - `versionCheckProgram`: The full path to the program that should print the `${version}` string. Defaults roughly to `${placeholder "out"}/bin/${pname}`. Using `$out` in the value of this variable won't work, as environment variables from this variable are not expanded by the hook. Hence using `placeholder` is unavoidable. - `versionCheckProgramArg`: The argument that needs to be passed to `versionCheckProgram`. If undefined the hook tries first `--help` and then `--version`. Examples: `version`, `-V`, `-v`. +- `versionCheckKeepEnvironment`: A list of environment variables to keep and pass to the command. Only those variables should be added to this list that are actually required for the version command to work. If it is not feasible to explicitly list all these environment variables you can set this parameter to the special value `"*"` to disable the `--ignore-environment` flag and thus keep all environment variables. - `preVersionCheck`: A hook to run before the check is done. - `postVersionCheck`: A hook to run after the check is done. diff --git a/lib/licenses.nix b/lib/licenses.nix index 91a09db4082d..7204e5e539c6 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -702,6 +702,18 @@ lib.mapAttrs mkLicense ( fullName = "Historic Permission Notice and Disclaimer"; }; + hpndDifferentDisclaimer = { + fullName = "HPND with different disclaimer"; + url = "https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/blob/1914233e662d23ffb3812b80fadd0bbd064ad91c/COPYING-x11proto#L69-88"; + # TODO: if the license gets accepted to spdx then + # add spdxId + # else + # remove license + # && replace reference with whatever this license is supposed to be then + # https://tools.spdx.org/app/license_requests/456 + # https://github.com/spdx/license-list-xml/issues/2753 + }; + hpndSellVariant = { fullName = "Historical Permission Notice and Disclaimer - sell variant"; spdxId = "HPND-sell-variant"; diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index d8c3cf2e3780..990eafa06677 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -85,16 +85,6 @@ let url = "https://gn.googlesource.com/gn"; inherit (upstream-info.deps.gn) rev hash; }; - - # Relax hardening as otherwise gn unstable 2024-06-06 and later fail with: - # cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security] - hardeningDisable = [ "format" ]; - - # At the time of writing, gn is at v2024-05-13 and has a backported patch. - # This patch appears to be already present in v2024-09-09 (from M130), which - # results in the patch not applying and thus failing the build. - # As a work around until gn is updated again, we filter specifically that patch out. - patches = lib.filter (e: lib.getName e != "LFS64.patch") oldAttrs.patches; }); }); diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix index cfdd6b54d50b..87bf879a2a59 100644 --- a/pkgs/applications/networking/sync/rsync/default.nix +++ b/pkgs/applications/networking/sync/rsync/default.nix @@ -18,6 +18,7 @@ enableZstd ? true, zstd, nixosTests, + fakeroot, }: stdenv.mkDerivation rec { @@ -47,6 +48,8 @@ stdenv.mkDerivation rec { ++ lib.optional enableOpenSSL openssl ++ lib.optional enableXXHash xxHash; + checkInputs = [ fakeroot ]; + configureFlags = [ (lib.enableFeature enableLZ4 "lz4") @@ -71,6 +74,8 @@ stdenv.mkDerivation rec { passthru.tests = { inherit (nixosTests) rsyncd; }; + doCheck = true; + meta = with lib; { description = "Fast incremental file transfer utility"; homepage = "https://rsync.samba.org/"; diff --git a/pkgs/build-support/setup-hooks/audit-tmpdir.sh b/pkgs/build-support/setup-hooks/audit-tmpdir.sh index 25fe203f813b..780f38bc1624 100644 --- a/pkgs/build-support/setup-hooks/audit-tmpdir.sh +++ b/pkgs/build-support/setup-hooks/audit-tmpdir.sh @@ -15,54 +15,27 @@ auditTmpdir() { echo "checking for references to $TMPDIR/ in $dir..." - local tmpdir elf_fifo script_fifo - tmpdir="$(mktemp -d)" - elf_fifo="$tmpdir/elf" - script_fifo="$tmpdir/script" - mkfifo "$elf_fifo" "$script_fifo" - - # Classifier: identify ELF and script files - ( - find "$dir" -type f -not -path '*/.build-id/*' -print0 \ - | while IFS= read -r -d $'\0' file; do - if isELF "$file"; then - printf '%s\0' "$file" >&3 - elif isScript "$file"; then - filename=${file##*/} - dir=${file%/*} - if [ -e "$dir/.$filename-wrapped" ]; then - printf '%s\0' "$file" >&4 + _processFile() { + local file="$1" + if isELF "$file"; then + if { printf :; patchelf --print-rpath "$file"; } | grep -q -F ":$TMPDIR/"; then + echo "RPATH of binary $file contains a forbidden reference to $TMPDIR/" + exit 1 + fi + elif isScript "$file"; then + filename=${i##*/} + dir=${i%/*} + if [ -e "$dir/.$filename-wrapped" ]; then + if grep -q -F "$TMPDIR/" "$file"; then + echo "wrapper script $file contains a forbidden reference to $TMPDIR/" + exit 1 fi fi - done - exec 3>&- 4>&- - ) 3> "$elf_fifo" 4> "$script_fifo" & + fi + } - # Handler: check RPATHs concurrently - ( - xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$elf_fifo" - ) & - local pid_elf=$! + find "$dir" -type f -not -path '*/.build-id/*' -print0 \ + | parallelMap _processFile - # Handler: check wrapper scripts concurrently - local pid_script - ( - xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if grep -q -F "$TMPDIR/" "$1"; then - echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$script_fifo" - ) & - local pid_script=$! - - wait "$pid_elf" || { echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; exit 1; } - wait "$pid_script" || { echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; exit 1; } - - rm -r "$tmpdir" + unset -f _processFile } diff --git a/pkgs/build-support/setup-hooks/parallel.sh b/pkgs/build-support/setup-hooks/parallel.sh new file mode 100644 index 000000000000..a7c8330a0de1 --- /dev/null +++ b/pkgs/build-support/setup-hooks/parallel.sh @@ -0,0 +1,89 @@ +# Parallel execution utilities +# These functions provide a framework for parallel processing of jobs from stdin + +# parallelRun - Execute a command in parallel across multiple cores +# +# Reads null-delimited jobs from stdin and distributes them across NIX_BUILD_CORES +# worker processes. Each worker executes the provided command, receiving jobs +# via stdin in null-delimited format. +# +# Usage: some_producer | parallelRun command [args...] +# +# The command receives jobs one at a time via stdin (null-delimited). +# +# Example: +# find . -name '*.log' -print0 | parallelRun sh -c ' +# while read -r -d "" file; do gzip "$file"; done +# ' +parallelRun() { + local pids + local lock + pids=() + lock=$(mktemp -u) + mkfifo "$lock" + for ((i=0; i"$lock" # fd-4 = write side of lock (push token back) + local job + + while :; do + # Acquire the lock: blocks until a token can be read + read -r -n1 >/dev/null <&3 + + # read one job from stdin + # This is guarded by the lock above in order to prevent + # multiple workers from reading from stdin simultaneously. + if ! IFS= read -r -d '' job; then + # If stdin is closed, release lock and exit + printf 'x' >&4 + break + fi + + # Release the lock: write a token back to the lock FIFO + printf 'y' >&4 + + # Forward job to the worker process' stdin + printf '%s\0' "$job" + + done \ + | "$@" # launch the worker process + } & + pids[$i]=$! + done + # launch the workers by writing a token to the lock FIFO + printf 'a' >"$lock" & + # Wait for all workers to finish + for pid in "${pids[@]}"; do + if ! wait "$pid"; then + echo "A parallel job failed with exit code $? (check for errors above)" >&2 + echo -e "Failing Command:\n $@" >&2 + exit 1 + fi + done + rm "$lock" +} + +# parallelMap - Apply a shell function to each job in parallel +# +# A higher-level wrapper around parallelRun that applies a shell function to each +# null-delimited job from stdin. The shell function receives each job as its first +# argument. +# +# Usage: some_producer | parallelMap shell_function [additional_args...] +# +# The shell function is called as: shell_function job [additional_args...] +# for each job read from stdin. +# +# Example: +# compress() { gzip "$1" } +# find . -name '*.log' -print0 | parallelMap compress +parallelMap() { + _wrapper() { + while IFS= read -r -d '' job; do + "$@" "$job" + done + } + parallelRun _wrapper "$@" + unset -f _wrapper +} diff --git a/pkgs/build-support/setup-hooks/tests/default.nix b/pkgs/build-support/setup-hooks/tests/default.nix new file mode 100644 index 000000000000..36cd73a1a9ee --- /dev/null +++ b/pkgs/build-support/setup-hooks/tests/default.nix @@ -0,0 +1,23 @@ +{ + stdenv, +}: +{ + # test based on bootstrap tools to prevent rebuilding stdenv on each change + parallel = + (derivation { + name = "test-parallel-hook"; + system = stdenv.system; + builder = "${stdenv.bootstrapTools}/bin/bash"; + PATH = "${stdenv.bootstrapTools}/bin"; + args = [ + "-c" + '' + . ${../parallel.sh} + . ${./test-parallel.sh} + '' + ]; + }) + // { + meta = { }; + }; +} diff --git a/pkgs/build-support/setup-hooks/tests/test-parallel.sh b/pkgs/build-support/setup-hooks/tests/test-parallel.sh new file mode 100644 index 000000000000..94e0fc6e8b73 --- /dev/null +++ b/pkgs/build-support/setup-hooks/tests/test-parallel.sh @@ -0,0 +1,146 @@ +export NIX_BUILD_CORES=4 + +echo "Testing worker distribution..." + +# Generate 100 jobs to ensure all workers get some +for i in {1..100}; do + printf "job%d\0" $i +done | parallelRun sh -c ' + while IFS= read -r -d "" job; do + sleep 0.05 # Simulate some work + echo "Worker $$ processed $job" >> /tmp/worker-output + done +' + +# Check that all 4 workers were actually utilized +worker_count=$(sort /tmp/worker-output | cut -d" " -f2 | sort -u | wc -l) +if [ "$worker_count" -ne 4 ]; then + echo "ERROR: Expected exactly 4 workers, got $worker_count" + cat /tmp/worker-output + exit 1 +fi +echo "SUCCESS: All 4 workers participated" +rm -f /tmp/worker-output + +echo "Testing error propagation..." + +# Test that errors from workers are propagated +if printf "job1\0job2\0job3\0" | parallelRun sh -c ' + while IFS= read -r -d "" job; do + if [ "$job" = "job2" ]; then + echo "Worker failing on $job" >&2 + exit 1 + fi + echo "Worker processed $job" + done +' 2>/dev/null; then + echo "ERROR: Expected command to fail but it succeeded" + exit 1 +else + echo "SUCCESS: Error was properly propagated" +fi + +echo "Testing error message..." + +error_output=$(printf "job1\0job2\0job3\0" | parallelRun sh -c ' + while IFS= read -r -d "" job; do + if [ "$job" = "job2" ]; then + echo "Worker failing on $job" >&2 + exit 1 + fi + echo "Worker processed $job" + done +' 2>&1 || true) + +if [[ "$error_output" != *"job failed"* ]]; then + echo "ERROR: Expected 'job failed' in error message, got: $error_output" + exit 1 +fi +echo "SUCCESS: Error message was displayed" + +echo "Testing Verify all jobs are processed when no errors occur..." + +# Generate jobs and count processed ones +for i in {1..10}; do + printf "job%d\0" $i +done | parallelRun sh -c ' + while IFS= read -r -d "" job; do + echo "$job" >> /tmp/processed-jobs + done +' + +processed_count=$(wc -l < /tmp/processed-jobs) +if [ "$processed_count" -ne 10 ]; then + echo "ERROR: Expected 10 jobs processed, got $processed_count" + exit 1 +fi +echo "SUCCESS: All 10 jobs were processed" +rm -f /tmp/processed-jobs + +echo "All parallelRun tests passed!" + +# --------------------------------------------------------------------- + +echo "Testing parallelMap basic functionality..." + +# Define a test function +testFunc() { + echo "Processing: $1" >> /tmp/map-output +} + +# Test that parallelMap calls the function with each job +for i in {1..5}; do + printf "item%d\0" $i +done | parallelMap testFunc + +# Check all jobs were processed +processed_map_count=$(wc -l < /tmp/map-output) +if [ "$processed_map_count" -ne 5 ]; then + echo "ERROR: Expected 5 items processed by parallelMap, got $processed_map_count" + exit 1 +fi +echo "SUCCESS: parallelMap processed all 5 items" +rm -f /tmp/map-output + +echo "Testing parallelMap error propagation..." + +# Define a function that fails on specific input +failFunc() { + if [ "$1" = "item2" ]; then + echo "Function failing on $1" >&2 + exit 1 + fi + echo "Function processed $1" +} + +# Test that errors are propagated +if printf "item1\0item2\0item3\0" | parallelMap failFunc 2>/dev/null; then + echo "ERROR: Expected parallelMap to fail but it succeeded" + exit 1 +else + echo "SUCCESS: parallelMap error was properly propagated" +fi + +echo "Testing parallelMap with additional arguments..." + +# Define a function that uses additional arguments +argFunc() { + echo "$1: $2" >> /tmp/map-args-output +} + +# Test with additional arguments +for i in {1..3}; do + printf "value%d\0" $i +done | parallelMap argFunc "PREFIX" + +# Check output contains the prefix +if ! grep -q "PREFIX: value1" /tmp/map-args-output; then + echo "ERROR: parallelMap did not pass additional arguments correctly" + cat /tmp/map-args-output + exit 1 +fi +echo "SUCCESS: parallelMap passed additional arguments correctly" +rm -f /tmp/map-args-output + +echo "All parallelRun and parallelMap tests passed!" +touch $out diff --git a/pkgs/by-name/an/andcli/package.nix b/pkgs/by-name/an/andcli/package.nix index eef0b52280f0..e2195afda84c 100644 --- a/pkgs/by-name/an/andcli/package.nix +++ b/pkgs/by-name/an/andcli/package.nix @@ -2,6 +2,8 @@ lib, fetchFromGitHub, buildGoModule, + versionCheckHook, + writableTmpDirAsHomeHook, }: buildGoModule (finalAttrs: { @@ -26,7 +28,13 @@ buildGoModule (finalAttrs: { "-X github.com/tjblackheart/andcli/v2/internal/buildinfo.AppVersion=${finalAttrs.src.tag}" ]; - # As stated in #404465 the versionCheckHook does not work so it is not used here + nativeInstallCheckInputs = [ + writableTmpDirAsHomeHook + versionCheckHook + ]; + versionCheckProgramArg = "--version"; + versionCheckKeepEnvironment = [ "HOME" ]; + doInstallCheck = true; meta = { homepage = "https://github.com/tjblackheart/andcli"; diff --git a/pkgs/by-name/au/auto-patchelf/source/auto-patchelf.py b/pkgs/by-name/au/auto-patchelf/source/auto-patchelf.py index cafb761ef870..3426752fa55a 100644 --- a/pkgs/by-name/au/auto-patchelf/source/auto-patchelf.py +++ b/pkgs/by-name/au/auto-patchelf/source/auto-patchelf.py @@ -235,6 +235,10 @@ def auto_patchelf_file(path: Path, runtime_deps: list[Path], append_rpaths: list except ELFError: return [] + # these platforms are packaged in nixpkgs with ld.so in a separate derivation + # than libc.so and friends. keep_libc is mandatory. + keep_libc |= file_osabi in ('ELFOSABI_FREEBSD', 'ELFOSABI_OPENBSD') + rpath = [] if file_is_dynamic_executable: print("setting interpreter of", path) diff --git a/pkgs/by-name/bc/bc/package.nix b/pkgs/by-name/bc/bc/package.nix index b58d9f7e0ebb..f020c93621be 100644 --- a/pkgs/by-name/bc/bc/package.nix +++ b/pkgs/by-name/bc/bc/package.nix @@ -5,6 +5,7 @@ buildPackages, fetchurl, flex, + lzip, readline, ed, texinfo, @@ -12,10 +13,10 @@ stdenv.mkDerivation rec { pname = "bc"; - version = "1.08.1"; + version = "1.08.2"; src = fetchurl { - url = "mirror://gnu/bc/bc-${version}.tar.xz"; - hash = "sha256-UVQwEVszNMY2MXUDRgoJUN/3mUCqMlnOLBqmfCiB0CM="; + url = "mirror://gnu/bc/bc-${version}.tar.lz"; + hash = "sha256-eeMeAiqEsx3YCYFQY9S46lkLQJY3pSxQ7J9Cwr8zJxE="; }; configureFlags = [ "--with-readline" ]; @@ -28,6 +29,7 @@ stdenv.mkDerivation rec { autoreconfHook ed flex + lzip texinfo # Libraries for build buildPackages.readline diff --git a/pkgs/by-name/bd/bdftopcf/package.nix b/pkgs/by-name/bd/bdftopcf/package.nix new file mode 100644 index 000000000000..0798ca5e6e7e --- /dev/null +++ b/pkgs/by-name/bd/bdftopcf/package.nix @@ -0,0 +1,42 @@ +{ + lib, + stdenv, + fetchurl, + pkg-config, + xorgproto, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "bdftopcf"; + version = "1.1.2"; + + src = fetchurl { + url = "mirror://xorg/individual/util/bdftopcf-${finalAttrs.version}.tar.xz"; + hash = "sha256-vGC+WQQzD6qj3dKu14dL7i8p5Dh8JF1nh1UvBn6wUjo="; + }; + + strictDeps = true; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ xorgproto ]; + + passthru = { + updateScript = writeScript "update-${finalAttrs.pname}" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts + version="$(list-directory-versions --pname ${finalAttrs.pname} \ + --url https://xorg.freedesktop.org/releases/individual/util/ \ + | sort -V | tail -n1)" + update-source-version ${finalAttrs.pname} "$version" + ''; + }; + + meta = { + description = "Converts X font from Bitmap Distribution Format to Portable Compiled Format"; + homepage = "https://gitlab.freedesktop.org/xorg/util/bdftopcf"; + license = lib.licenses.mitOpenGroup; + mainProgram = "bdftopcf"; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/by-name/ca/cargo-seek/package.nix b/pkgs/by-name/ca/cargo-seek/package.nix index e3f44a9c565f..8d665635f2ea 100644 --- a/pkgs/by-name/ca/cargo-seek/package.nix +++ b/pkgs/by-name/ca/cargo-seek/package.nix @@ -22,13 +22,9 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-DyXRbtvCJte7mCQKusipeikr981vMHPEVYcGSwVI5Kg="; - nativeBuildInputs = [ - pkg-config - ]; + nativeBuildInputs = [ pkg-config ]; - buildInputs = [ - openssl - ]; + buildInputs = [ openssl ]; doInstallCheck = true; nativeInstallCheckInputs = [ @@ -36,7 +32,7 @@ rustPlatform.buildRustPackage (finalAttrs: { writableTmpDirAsHomeHook ]; versionCheckProgramArg = "--version"; - versionCheckDontIgnoreEnvironment = true; + versionCheckKeepEnvironment = [ "HOME" ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/cr/crc/package.nix b/pkgs/by-name/cr/crc/package.nix index 9cc8c078bbda..61d50c67af92 100644 --- a/pkgs/by-name/cr/crc/package.nix +++ b/pkgs/by-name/cr/crc/package.nix @@ -47,12 +47,12 @@ buildGoModule (finalAttrs: { ]; doInstallCheck = true; - nativeCheckInputs = [ + nativeInstallCheckInputs = [ versionCheckHook writableTmpDirAsHomeHook ]; versionCheckProgramArg = "version"; - versionCheckDontIgnoreEnvironment = true; + versionCheckKeepEnvironment = [ "HOME" ]; passthru.updateScript = ./update.sh; diff --git a/pkgs/by-name/cu/curlMinimal/fix-add_handle-resizing.patch b/pkgs/by-name/cu/curlMinimal/fix-add_handle-resizing.patch deleted file mode 100644 index 4b7e58a8eab3..000000000000 --- a/pkgs/by-name/cu/curlMinimal/fix-add_handle-resizing.patch +++ /dev/null @@ -1,209 +0,0 @@ -From d16ccbd55de80c271fe822f4ba8b6271fd9166ff Mon Sep 17 00:00:00 2001 -From: Stefan Eissing -Date: Wed, 28 May 2025 14:04:31 +0200 -Subject: [PATCH] multi: fix add_handle resizing - -Due to someone being stupid, the resizing of the multi's transfer -table was actually shrinking it. Oh my. - -Add test751 to reproduce, add code assertion. - -Fixes #17473 -Reported-by: Jeroen Ooms -Closes #17475 ---- - lib/multi.c | 3 +- - tests/data/Makefile.am | 2 +- - tests/data/test751 | 33 ++++++++++++++ - tests/libtest/Makefile.inc | 4 ++ - tests/libtest/lib751.c | 92 ++++++++++++++++++++++++++++++++++++++ - 5 files changed, 132 insertions(+), 2 deletions(-) - create mode 100644 tests/data/test751 - create mode 100644 tests/libtest/lib751.c - -diff --git a/lib/multi.c b/lib/multi.c -index 792b30515d8b..b744e03ae52f 100644 ---- a/lib/multi.c -+++ b/lib/multi.c -@@ -347,7 +347,8 @@ static CURLMcode multi_xfers_add(struct Curl_multi *multi, - if(unused <= min_unused) { - /* make it a 64 multiple, since our bitsets frow by that and - * small (easy_multi) grows to at least 64 on first resize. */ -- unsigned int newsize = ((capacity + min_unused) + 63) / 64; -+ unsigned int newsize = (((capacity + min_unused) + 63) / 64) * 64; -+ DEBUGASSERT(newsize > capacity); - /* Grow the bitsets first. Should one fail, we do not need - * to downsize the already resized ones. The sets continue - * to work properly when larger than the table, but not -diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am -index e8f9e12be71e..16bb57db8e69 100644 ---- a/tests/data/Makefile.am -+++ b/tests/data/Makefile.am -@@ -107,7 +107,7 @@ test709 test710 test711 test712 test713 test714 test715 test716 test717 \ - test718 test719 test720 test721 test722 test723 test724 test725 test726 \ - test727 test728 test729 test730 test731 test732 test733 test734 test735 \ - test736 test737 test738 test739 test740 test741 test742 test743 test744 \ --test745 test746 test747 test748 test749 test750 \ -+test745 test746 test747 test748 test749 test750 test751 \ - \ - test780 test781 test782 test783 test784 test785 test786 test787 test788 \ - test789 test790 test791 \ -diff --git a/tests/data/test751 b/tests/data/test751 -new file mode 100644 -index 000000000000..ffc6df512f83 ---- /dev/null -+++ b/tests/data/test751 -@@ -0,0 +1,33 @@ -+ -+ -+ -+MULTI -+ -+ -+ -+ -+ -+ -+ -+# Client-side -+ -+ -+none -+ -+# tool is what to use instead of 'curl' -+ -+lib%TESTNUMBER -+ -+ -+ -+multi - add many easy handles -+ -+ -+ -+ -+ -+ -+# Verify data after the test has been "shot" -+ -+ -+ -diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc -index faf7eacdf6af..002e7ab5470d 100644 ---- a/tests/libtest/Makefile.inc -+++ b/tests/libtest/Makefile.inc -@@ -50,6 +50,7 @@ LIBTESTPROGS = libauthretry libntlmconnect libprereq \ - lib659 lib661 lib666 lib667 lib668 \ - lib670 lib671 lib672 lib673 lib674 lib676 lib677 lib678 lib694 lib695 \ - lib696 \ -+ lib751 \ - lib1156 \ - lib1301 \ - lib1308 \ -@@ -349,6 +350,9 @@ lib695_SOURCES = lib695.c $(SUPPORTFILES) - lib696_SOURCES = lib556.c $(SUPPORTFILES) $(WARNLESS) - lib696_CPPFLAGS = $(AM_CPPFLAGS) -DLIB696 - -+lib751_SOURCES = lib751.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) -+lib751_LDADD = $(TESTUTIL_LIBS) -+ - lib1301_SOURCES = lib1301.c $(SUPPORTFILES) $(TESTUTIL) - lib1301_LDADD = $(TESTUTIL_LIBS) - -diff --git a/tests/libtest/lib751.c b/tests/libtest/lib751.c -new file mode 100644 -index 000000000000..ab2f923b959d ---- /dev/null -+++ b/tests/libtest/lib751.c -@@ -0,0 +1,92 @@ -+/*************************************************************************** -+ * _ _ ____ _ -+ * Project ___| | | | _ \| | -+ * / __| | | | |_) | | -+ * | (__| |_| | _ <| |___ -+ * \___|\___/|_| \_\_____| -+ * -+ * Copyright (C) Daniel Stenberg, , et al. -+ * -+ * This software is licensed as described in the file COPYING, which -+ * you should have received as part of this distribution. The terms -+ * are also available at https://curl.se/docs/copyright.html. -+ * -+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell -+ * copies of the Software, and permit persons to whom the Software is -+ * furnished to do so, under the terms of the COPYING file. -+ * -+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -+ * KIND, either express or implied. -+ * -+ * SPDX-License-Identifier: curl -+ * -+ ***************************************************************************/ -+#include "test.h" -+ -+#include "testutil.h" -+#include "warnless.h" -+#include "memdebug.h" -+ -+#define TEST_HANG_TIMEOUT 60 * 1000 -+ -+/* -+ * Get a single URL without select(). -+ */ -+ -+CURLcode test(char *URL) -+{ -+ CURL *easies[1000]; -+ CURLM *m; -+ CURLcode res = CURLE_FAILED_INIT; -+ CURLMcode mres; -+ int i; -+ -+ (void)URL; -+ memset(easies, 0, sizeof(easies)); -+ -+ curl_global_init(CURL_GLOBAL_DEFAULT); -+ m = curl_multi_init(); -+ if(!m) { -+ res = CURLE_OUT_OF_MEMORY; -+ goto test_cleanup; -+ } -+ -+ for(i = 0; i < 1000; i++) { -+ CURL *e = curl_easy_init(); -+ if(!e) { -+ res = CURLE_OUT_OF_MEMORY; -+ goto test_cleanup; -+ } -+ easies[i] = e; -+ -+ res = curl_easy_setopt(e, CURLOPT_URL, "https://www.example.com/"); -+ if(!res) -+ res = curl_easy_setopt(e, CURLOPT_VERBOSE, 1L); -+ if(res) -+ goto test_cleanup; -+ -+ mres = curl_multi_add_handle(m, e); -+ if(mres != CURLM_OK) { -+ printf("MULTI ERROR: %s\n", curl_multi_strerror(mres)); -+ res = CURLE_FAILED_INIT; -+ goto test_cleanup; -+ } -+ } -+ -+test_cleanup: -+ -+ if(res) -+ printf("ERROR: %s\n", curl_easy_strerror(res)); -+ -+ for(i = 0; i < 1000; i++) { -+ if(easies[i]) { -+ curl_multi_add_handle(m, easies[i]); -+ curl_easy_cleanup(easies[i]); -+ easies[i] = NULL; -+ } -+ } -+ curl_multi_cleanup(m); -+ curl_global_cleanup(); -+ -+ return res; -+} diff --git a/pkgs/by-name/cu/curlMinimal/package.nix b/pkgs/by-name/cu/curlMinimal/package.nix index f4393335b738..e84bce6fafd9 100644 --- a/pkgs/by-name/cu/curlMinimal/package.nix +++ b/pkgs/by-name/cu/curlMinimal/package.nix @@ -91,7 +91,7 @@ in stdenv.mkDerivation (finalAttrs: { pname = "curl"; - version = "8.14.0"; + version = "8.14.1"; src = fetchurl { urls = [ @@ -100,16 +100,9 @@ stdenv.mkDerivation (finalAttrs: { builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version }/curl-${finalAttrs.version}.tar.xz" ]; - hash = "sha256-s2NM/FOMcsnGynlO9Mc9f9vRceje4tuDfYOl5FIxACo="; + hash = "sha256-9GGaHiR0xLv+3IinwhkSCcgzS0j6H05T/VhMwS6RIN0="; }; - patches = [ - # Backport of https://github.com/curl/curl/commit/d16ccbd55de80c271fe822f4ba8b6271fd9166ff - # Fixes a regression introduced in 8.14.0 - # Remove with 8.14.1 - ./fix-add_handle-resizing.patch - ]; - # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion # necessary for FreeBSD code path in configure postPatch = '' diff --git a/pkgs/by-name/ec/ec2-instance-selector/package.nix b/pkgs/by-name/ec/ec2-instance-selector/package.nix index c6620d0af98f..8d37de3d7d11 100644 --- a/pkgs/by-name/ec/ec2-instance-selector/package.nix +++ b/pkgs/by-name/ec/ec2-instance-selector/package.nix @@ -31,6 +31,9 @@ buildGoModule (finalAttrs: { mv $out/bin/cmd $out/bin/ec2-instance-selector ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + versionCheckKeepEnvironment = [ "HOME" ]; doInstallCheck = true; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/gd/gdbm/freebsd-patch-src-lock-c.patch b/pkgs/by-name/gd/gdbm/freebsd-patch-src-lock-c.patch new file mode 100644 index 000000000000..4312cf998d60 --- /dev/null +++ b/pkgs/by-name/gd/gdbm/freebsd-patch-src-lock-c.patch @@ -0,0 +1,37 @@ +https://github.com/freebsd/freebsd-ports/blob/e198aef78afa4fd78ddc62fb5d0f7caa1b076bb0/databases/gdbm/files/patch-src_lock.c + +--- a/src/lock.c.orig 2025-03-06 16:24:09 UTC ++++ b/src/lock.c +@@ -73,15 +73,10 @@ try_lock_flock (GDBM_FILE dbf, int nb) + { + return TRY_LOCK_OK; + } +- else if (errno == EWOULDBLOCK) ++ else if (errno == EWOULDBLOCK || errno == EINTR) + { + return TRY_LOCK_FAIL; + } +- else if (errno == EINTR) +- { +- errno = ETIME; +- return TRY_LOCK_FAIL; +- } + #endif + return TRY_LOCK_NEXT; + } +@@ -116,7 +111,6 @@ try_lock_lockf (GDBM_FILE dbf, int nb) + switch (errno) + { + case EINTR: +- errno = ETIME; + case EACCES: + case EAGAIN: + case EDEADLK: +@@ -162,7 +156,6 @@ try_lock_fcntl (GDBM_FILE dbf, int nb) + switch (errno) + { + case EINTR: +- errno = ETIME; + case EACCES: + case EAGAIN: + case EDEADLK: diff --git a/pkgs/by-name/gd/gdbm/package.nix b/pkgs/by-name/gd/gdbm/package.nix index c707a23cfeaf..28cfd69edadb 100644 --- a/pkgs/by-name/gd/gdbm/package.nix +++ b/pkgs/by-name/gd/gdbm/package.nix @@ -1,6 +1,7 @@ { lib, fetchurl, + fetchpatch, stdenv, testers, updateAutotoolsGnuConfigScriptsHook, @@ -15,12 +16,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-0C2zxZJu2Hf4gXuBzR+S9T73TKjG21Q/u6AnGzTzk+w="; }; - patches = [ - # Remove on next release. - ./upstream-darwin-clock-nanosleep-fix.patch - ./upstream-lockwait-test-fixes.patch - ./upstream-musl-ssize_t-fix.patch - ]; + patches = + [ + # Remove on next release. + ./upstream-darwin-clock-nanosleep-fix.patch + ./upstream-lockwait-test-fixes.patch + ./upstream-musl-ssize_t-fix.patch + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + ./freebsd-patch-src-lock-c.patch + ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; diff --git a/pkgs/by-name/gn/gn/generic.nix b/pkgs/by-name/gn/gn/generic.nix index ca28240fa705..37f2fe251513 100644 --- a/pkgs/by-name/gn/gn/generic.nix +++ b/pkgs/by-name/gn/gn/generic.nix @@ -40,15 +40,6 @@ stdenv.mkDerivation { inherit rev sha256; }; - patches = [ - (fetchpatch { - name = "LFS64.patch"; - url = "https://gn.googlesource.com/gn/+/b5ff50936a726ff3c8d4dfe2a0ae120e6ce1350d%5E%21/?format=TEXT"; - decode = "base64 -d"; - hash = "sha256-/kh8t/Ip1EG2OIhydS//st/C80KJ4P31vGx7j8QpFh0="; - }) - ]; - nativeBuildInputs = [ ninja python3 @@ -58,6 +49,9 @@ stdenv.mkDerivation { ]; env.NIX_CFLAGS_COMPILE = "-Wno-error"; + # Relax hardening as otherwise gn unstable 2024-06-06 and later fail with: + # cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security] + hardeningDisable = [ "format" ]; buildPhase = '' python build/gen.py --no-last-commit-position diff --git a/pkgs/by-name/gn/gn/package.nix b/pkgs/by-name/gn/gn/package.nix index 33386b79dc0a..fa3322edd222 100644 --- a/pkgs/by-name/gn/gn/package.nix +++ b/pkgs/by-name/gn/gn/package.nix @@ -1,10 +1,10 @@ { callPackage, ... }@args: callPackage ./generic.nix args { - # Note: Please use the recommended version for Chromium stabe, i.e. from - # /pkgs/applications/networking/browsers/chromium/upstream-info.nix - rev = "df98b86690c83b81aedc909ded18857296406159"; - revNum = "2168"; # git describe $rev --match initial-commit | cut -d- -f3 - version = "2024-05-13"; - sha256 = "sha256-mNoQeHSSM+rhR0UHrpbyzLJC9vFqfxK1SD0X8GiRsqw="; + # Note: Please use the recommended version for Chromium stable, i.e. from + # /pkgs/applications/networking/browsers/chromium/info.json + rev = "85cc21e94af590a267c1c7a47020d9b420f8a033"; + revNum = "2233"; # git describe $rev --match initial-commit | cut -d- -f3 + version = "2025-04-28"; + sha256 = "sha256-+nKP2hBUKIqdNfDz1vGggXSdCuttOt0GwyGUQ3Z1ZHI="; } diff --git a/pkgs/by-name/hi/hidapi/package.nix b/pkgs/by-name/hi/hidapi/package.nix index 007e98379424..b4465a854b89 100644 --- a/pkgs/by-name/hi/hidapi/package.nix +++ b/pkgs/by-name/hi/hidapi/package.nix @@ -11,13 +11,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "hidapi"; - version = "0.14.0"; + version = "0.15.0"; src = fetchFromGitHub { owner = "libusb"; repo = "hidapi"; rev = "hidapi-${finalAttrs.version}"; - sha256 = "sha256-p3uzBq5VxxQbVuy1lEHEEQdxXwnhQgJDIyAAWjVWNIg="; + sha256 = "sha256-o6IZRG42kTa7EQib9eaV1HGyjaGgeCabk+8fyQTm/0s="; }; nativeBuildInputs = [ diff --git a/pkgs/by-name/hw/hwdata/package.nix b/pkgs/by-name/hw/hwdata/package.nix index c04f16388996..8f4966a9bd86 100644 --- a/pkgs/by-name/hw/hwdata/package.nix +++ b/pkgs/by-name/hw/hwdata/package.nix @@ -6,13 +6,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "hwdata"; - version = "0.395"; + version = "0.396"; src = fetchFromGitHub { owner = "vcrhonek"; repo = "hwdata"; rev = "v${finalAttrs.version}"; - hash = "sha256-wLdJGaJVqClso75iRSpSVlobdx7Rv01YreiPsDzwjok="; + hash = "sha256-fn+Dcl7R3PADoTuilSQrXFBnXQM1c66jliTc0G89RIQ="; }; doCheck = false; # this does build machine-specific checks (e.g. enumerates PCI bus) diff --git a/pkgs/by-name/ib/ibusMinimal/package.nix b/pkgs/by-name/ib/ibusMinimal/package.nix new file mode 100644 index 000000000000..a828d049c66e --- /dev/null +++ b/pkgs/by-name/ib/ibusMinimal/package.nix @@ -0,0 +1 @@ +{ ibus }: ibus.override { libOnly = true; } diff --git a/pkgs/servers/x11/xorg/imake-cc-wrapper-uberhack.patch b/pkgs/by-name/im/imake/cc-wrapper-uberhack.patch similarity index 100% rename from pkgs/servers/x11/xorg/imake-cc-wrapper-uberhack.patch rename to pkgs/by-name/im/imake/cc-wrapper-uberhack.patch diff --git a/pkgs/servers/x11/xorg/imake.patch b/pkgs/by-name/im/imake/disable-autodetection.patch similarity index 100% rename from pkgs/servers/x11/xorg/imake.patch rename to pkgs/by-name/im/imake/disable-autodetection.patch diff --git a/pkgs/by-name/im/imake/package.nix b/pkgs/by-name/im/imake/package.nix new file mode 100644 index 000000000000..a04cbadc8527 --- /dev/null +++ b/pkgs/by-name/im/imake/package.nix @@ -0,0 +1,84 @@ +{ + lib, + stdenv, + fetchurl, + tradcpp, + xorg-cf-files, + pkg-config, + xorgproto, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "imake"; + version = "1.0.10"; + + src = fetchurl { + url = "mirror://xorg/individual/util/imake-${finalAttrs.version}.tar.xz"; + hash = "sha256-dd7LzqjXs1TPNq3JZ15TxHkO495WoUvYe0LI6KrS7PU="; + }; + + patches = [ + # Disable imake autodetection for: + # - LinuxDistribution to avoid injection of /usr paths + # - gcc to avoid use uf /usr/bin/gcc + # https://github.com/NixOS/nixpkgs/issues/135337 + ./disable-autodetection.patch + # uberhack to workaround broken 'gcc -x c' + # + # Our cc-wrapper is broken whenever the '-x' flag is used: + # 'gcc -x c foo.c -o bar' doesn't work the same way as 'gcc foo.c -o bar' + # does. (Try both with NIX_DEBUG=1.) + # + # What happens is that passing '-x' causes linker-related flags (such as + # -Wl,-dynamic-linker) not to be added, just like if '-c' is passed. + # The bug happens outside the multiple-outputs branch as well, but it + # doesn't break imake there. It only breaks in multiple-outputs because + # linking without -Wl,-dynamic-linker produces a binary with an invalid + # ELF interpreter path. (Which arguably, is a bug in its own.) + # (copied from the commit message on 0100b270694ecab8aaa13fa5f3d30639b50d7777) + ./cc-wrapper-uberhack.patch + ]; + + strictDeps = true; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ xorgproto ]; + + configureFlags = [ + "ac_cv_path_RAWCPP=${stdenv.cc.targetPrefix}cpp" + ]; + + env = { + CFLAGS = "-DIMAKE_COMPILETIME_CPP='\"${ + if stdenv.hostPlatform.isDarwin then "${tradcpp}/bin/cpp" else "gcc" + }\"'"; + }; + + inherit tradcpp xorg-cf-files; + setupHook = ./setup-hook.sh; + x11BuildHook = ./x11-build-hook.sh; + + passthru = { + updateScript = writeScript "update-${finalAttrs.pname}" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts + version="$(list-directory-versions --pname ${finalAttrs.pname} \ + --url https://xorg.freedesktop.org/releases/individual/util/ \ + | sort -V | tail -n1)" + update-source-version ${finalAttrs.pname} "$version" + ''; + }; + + meta = { + description = "Obsolete C preprocessor interface to the make utility"; + homepage = "https://gitlab.freedesktop.org/xorg/util/imake"; + license = with lib.licenses; [ + mitOpenGroup + x11 + ]; + mainProgram = "imake"; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/servers/x11/xorg/imake-setup-hook.sh b/pkgs/by-name/im/imake/setup-hook.sh similarity index 100% rename from pkgs/servers/x11/xorg/imake-setup-hook.sh rename to pkgs/by-name/im/imake/setup-hook.sh diff --git a/pkgs/servers/x11/xorg/imake.sh b/pkgs/by-name/im/imake/x11-build-hook.sh similarity index 100% rename from pkgs/servers/x11/xorg/imake.sh rename to pkgs/by-name/im/imake/x11-build-hook.sh diff --git a/pkgs/by-name/jq/jq/0001-Improve-performance-of-repeating-strings-3272.patch b/pkgs/by-name/jq/jq/0001-Improve-performance-of-repeating-strings-3272.patch deleted file mode 100644 index 90a9f5601b83..000000000000 --- a/pkgs/by-name/jq/jq/0001-Improve-performance-of-repeating-strings-3272.patch +++ /dev/null @@ -1,118 +0,0 @@ -From c15fc903e00fdd3b460e64d5a6a540f944e1eca6 Mon Sep 17 00:00:00 2001 -From: itchyny -Date: Tue, 4 Mar 2025 22:13:55 +0900 -Subject: [PATCH 1/5] Improve performance of repeating strings (#3272) - -This commit improves the performance of repeating strings, by copying -the result string instead of the string being repeated. Also it adds -an error message when the result string is too long. ---- - src/builtin.c | 15 ++------------- - src/jv.c | 26 ++++++++++++++++++++++++++ - src/jv.h | 1 + - tests/jq.test | 12 ++++++++++++ - 4 files changed, 41 insertions(+), 13 deletions(-) - -diff --git a/src/builtin.c b/src/builtin.c -index 902490d..abb99f4 100644 ---- a/src/builtin.c -+++ b/src/builtin.c -@@ -369,21 +369,10 @@ jv binop_multiply(jv a, jv b) { - str = b; - num = a; - } -- jv res; - double d = jv_number_value(num); -- if (d < 0 || isnan(d)) { -- res = jv_null(); -- } else { -- int n = d; -- size_t alen = jv_string_length_bytes(jv_copy(str)); -- res = jv_string_empty(alen * n); -- for (; n > 0; n--) { -- res = jv_string_append_buf(res, jv_string_value(str), alen); -- } -- } -- jv_free(str); - jv_free(num); -- return res; -+ return jv_string_repeat(str, -+ d < 0 || isnan(d) ? -1 : d > INT_MAX ? INT_MAX : (int)d); - } else if (ak == JV_KIND_OBJECT && bk == JV_KIND_OBJECT) { - return jv_object_merge_recursive(a, b); - } else { -diff --git a/src/jv.c b/src/jv.c -index e23d8ec..e0478c8 100644 ---- a/src/jv.c -+++ b/src/jv.c -@@ -1291,6 +1291,32 @@ jv jv_string_indexes(jv j, jv k) { - return a; - } - -+jv jv_string_repeat(jv j, int n) { -+ assert(JVP_HAS_KIND(j, JV_KIND_STRING)); -+ if (n < 0) { -+ jv_free(j); -+ return jv_null(); -+ } -+ int len = jv_string_length_bytes(jv_copy(j)); -+ int64_t res_len = (int64_t)len * n; -+ if (res_len >= INT_MAX) { -+ jv_free(j); -+ return jv_invalid_with_msg(jv_string("Repeat string result too long")); -+ } -+ if (res_len == 0) { -+ jv_free(j); -+ return jv_string(""); -+ } -+ jv res = jv_string_empty(res_len); -+ res = jvp_string_append(res, jv_string_value(j), len); -+ for (int curr = len, grow; curr < res_len; curr += grow) { -+ grow = MIN(res_len - curr, curr); -+ res = jvp_string_append(res, jv_string_value(res), grow); -+ } -+ jv_free(j); -+ return res; -+} -+ - jv jv_string_split(jv j, jv sep) { - assert(JVP_HAS_KIND(j, JV_KIND_STRING)); - assert(JVP_HAS_KIND(sep, JV_KIND_STRING)); -diff --git a/src/jv.h b/src/jv.h -index 083509e..a9b13ae 100644 ---- a/src/jv.h -+++ b/src/jv.h -@@ -131,6 +131,7 @@ jv jv_string_fmt(const char*, ...) JV_PRINTF_LIKE(1, 2); - jv jv_string_append_codepoint(jv a, uint32_t c); - jv jv_string_append_buf(jv a, const char* buf, int len); - jv jv_string_append_str(jv a, const char* str); -+jv jv_string_repeat(jv j, int n); - jv jv_string_split(jv j, jv sep); - jv jv_string_explode(jv j); - jv jv_string_implode(jv j); -diff --git a/tests/jq.test b/tests/jq.test -index 7036df2..e82cf84 100644 ---- a/tests/jq.test -+++ b/tests/jq.test -@@ -1365,6 +1365,18 @@ indices(", ") - "abc" - [null,null] - -+. * 100000 | [.[:10],.[-10:]] -+"abc" -+["abcabcabca","cabcabcabc"] -+ -+. * 1000000000 -+"" -+"" -+ -+try (. * 1000000000) catch . -+"abc" -+"Repeat string result too long" -+ - [.[] / ","] - ["a, bc, def, ghij, jklmn, a,b, c,d, e,f", "a,b,c,d, e,f,g,h"] - [["a"," bc"," def"," ghij"," jklmn"," a","b"," c","d"," e","f"],["a","b","c","d"," e","f","g","h"]] --- -2.49.0 - diff --git a/pkgs/by-name/jq/jq/0002-fix-jv_number_value-should-cache-the-double-value-of.patch b/pkgs/by-name/jq/jq/0002-fix-jv_number_value-should-cache-the-double-value-of.patch deleted file mode 100644 index 17da9af6ca41..000000000000 --- a/pkgs/by-name/jq/jq/0002-fix-jv_number_value-should-cache-the-double-value-of.patch +++ /dev/null @@ -1,66 +0,0 @@ -From df0ddb83feb656230157f5bc9b7f34caef1f82be Mon Sep 17 00:00:00 2001 -From: itchyny -Date: Sun, 16 Feb 2025 22:08:36 +0900 -Subject: [PATCH 2/5] fix: `jv_number_value` should cache the double value of - literal numbers (#3245) - -The code of `jv_number_value` is intended to cache the double value of -literal numbers, but it does not work because it accepts the `jv` struct -by value. This patch fixes the behavior by checking if the double value -is `NaN`, which indicates the unconverted value. This patch improves the -performance of major use cases; e.g. `range(1000000)` runs 25% faster. ---- - src/jv.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/jv.c b/src/jv.c -index e0478c8..418d57d 100644 ---- a/src/jv.c -+++ b/src/jv.c -@@ -206,9 +206,6 @@ enum { - JVP_NUMBER_DECIMAL = 1 - }; - --#define JV_NUMBER_SIZE_INIT (0) --#define JV_NUMBER_SIZE_CONVERTED (1) -- - #define JVP_FLAGS_NUMBER_NATIVE JVP_MAKE_FLAGS(JV_KIND_NUMBER, JVP_MAKE_PFLAGS(JVP_NUMBER_NATIVE, 0)) - #define JVP_FLAGS_NUMBER_LITERAL JVP_MAKE_FLAGS(JV_KIND_NUMBER, JVP_MAKE_PFLAGS(JVP_NUMBER_DECIMAL, 1)) - -@@ -589,8 +586,12 @@ static jv jvp_literal_number_new(const char * literal) { - jv_mem_free(n); - return JV_INVALID; - } -+ if (decNumberIsNaN(&n->num_decimal)) { -+ jv_mem_free(n); -+ return jv_number(NAN); -+ } - -- jv r = {JVP_FLAGS_NUMBER_LITERAL, 0, 0, JV_NUMBER_SIZE_INIT, {&n->refcnt}}; -+ jv r = {JVP_FLAGS_NUMBER_LITERAL, 0, 0, 0, {&n->refcnt}}; - return r; - } - -@@ -698,9 +699,8 @@ double jv_number_value(jv j) { - if (JVP_HAS_FLAGS(j, JVP_FLAGS_NUMBER_LITERAL)) { - jvp_literal_number* n = jvp_literal_number_ptr(j); - -- if (j.size != JV_NUMBER_SIZE_CONVERTED) { -+ if (isnan(n->num_double)) { - n->num_double = jvp_literal_number_to_double(j); -- j.size = JV_NUMBER_SIZE_CONVERTED; - } - - return n->num_double; -@@ -731,7 +731,7 @@ int jvp_number_is_nan(jv n) { - return decNumberIsNaN(pdec); - } - #endif -- return n.u.number != n.u.number; -+ return isnan(n.u.number); - } - - int jvp_number_cmp(jv a, jv b) { --- -2.49.0 - diff --git a/pkgs/by-name/jq/jq/0003-Reject-NaN-with-payload-while-parsing-JSON.patch b/pkgs/by-name/jq/jq/0003-Reject-NaN-with-payload-while-parsing-JSON.patch deleted file mode 100644 index cf3135d2a3a3..000000000000 --- a/pkgs/by-name/jq/jq/0003-Reject-NaN-with-payload-while-parsing-JSON.patch +++ /dev/null @@ -1,75 +0,0 @@ -From dfd25612454deacb6df47329787844795bf59821 Mon Sep 17 00:00:00 2001 -From: itchyny -Date: Wed, 5 Mar 2025 07:43:54 +0900 -Subject: [PATCH 3/5] Reject NaN with payload while parsing JSON - -This commit drops support for parsing NaN with payload in JSON like -`NaN123` and fixes CVE-2024-53427. Other JSON extensions like `NaN` and -`Infinity` are still supported. Fixes #3023, fixes #3196, fixes #3246. ---- - src/jv.c | 5 +++++ - tests/jq.test | 14 ++++++++++---- - tests/shtest | 5 ----- - 3 files changed, 15 insertions(+), 9 deletions(-) - -diff --git a/src/jv.c b/src/jv.c -index 418d57d..6147775 100644 ---- a/src/jv.c -+++ b/src/jv.c -@@ -587,6 +587,11 @@ static jv jvp_literal_number_new(const char * literal) { - return JV_INVALID; - } - if (decNumberIsNaN(&n->num_decimal)) { -+ // Reject NaN with payload. -+ if (n->num_decimal.digits > 1 || *n->num_decimal.lsu != 0) { -+ jv_mem_free(n); -+ return JV_INVALID; -+ } - jv_mem_free(n); - return jv_number(NAN); - } -diff --git a/tests/jq.test b/tests/jq.test -index e82cf84..97835f2 100644 ---- a/tests/jq.test -+++ b/tests/jq.test -@@ -1950,11 +1950,17 @@ tojson | fromjson - {"a":nan} - {"a":null} - --# also "nan with payload" #2985 --fromjson | isnan --"nan1234" -+# NaN with payload is not parsed -+.[] | try (fromjson | isnan) catch . -+["NaN","-NaN","NaN1","NaN10","NaN100","NaN1000","NaN10000","NaN100000"] - true -- -+true -+"Invalid numeric literal at EOF at line 1, column 4 (while parsing 'NaN1')" -+"Invalid numeric literal at EOF at line 1, column 5 (while parsing 'NaN10')" -+"Invalid numeric literal at EOF at line 1, column 6 (while parsing 'NaN100')" -+"Invalid numeric literal at EOF at line 1, column 7 (while parsing 'NaN1000')" -+"Invalid numeric literal at EOF at line 1, column 8 (while parsing 'NaN10000')" -+"Invalid numeric literal at EOF at line 1, column 9 (while parsing 'NaN100000')" - - # calling input/0, or debug/0 in a test doesn't crash jq - -diff --git a/tests/shtest b/tests/shtest -index 14aafbf..a471889 100755 ---- a/tests/shtest -+++ b/tests/shtest -@@ -594,11 +594,6 @@ if ! x=$($JQ -n "1 # foo$cr + 2") || [ "$x" != 1 ]; then - exit 1 - fi - --# CVE-2023-50268: No stack overflow comparing a nan with a large payload --$VALGRIND $Q $JQ '1 != .' <<\EOF >/dev/null --Nan4000 --EOF -- - # Allow passing the inline jq script before -- #2919 - if ! r=$($JQ --args -rn -- '$ARGS.positional[0]' bar) || [ "$r" != bar ]; then - echo "passing the inline script after -- didn't work" --- -2.49.0 - diff --git a/pkgs/by-name/jq/jq/0004-Fix-signed-integer-overflow-in-jvp_array_write-and-j.patch b/pkgs/by-name/jq/jq/0004-Fix-signed-integer-overflow-in-jvp_array_write-and-j.patch deleted file mode 100644 index 8a54eb3ad056..000000000000 --- a/pkgs/by-name/jq/jq/0004-Fix-signed-integer-overflow-in-jvp_array_write-and-j.patch +++ /dev/null @@ -1,215 +0,0 @@ -From dc65d5af447f266d8a4037551e028785aab31e04 Mon Sep 17 00:00:00 2001 -From: itchyny -Date: Wed, 21 May 2025 07:45:00 +0900 -Subject: [PATCH 4/5] Fix signed integer overflow in jvp_array_write and - jvp_object_rehash - -This commit fixes signed integer overflow and SEGV issues on growing -arrays and objects. The size of arrays and objects is now limited to -`536870912` (`0x20000000`). This fixes CVE-2024-23337 and fixes #3262. ---- - src/jv.c | 45 ++++++++++++++++++++++++++++++++++++--------- - src/jv_aux.c | 9 +++++---- - tests/jq.test | 4 ++++ - 3 files changed, 45 insertions(+), 13 deletions(-) - -diff --git a/src/jv.c b/src/jv.c -index 6147775..6e8cdd3 100644 ---- a/src/jv.c -+++ b/src/jv.c -@@ -997,6 +997,11 @@ jv jv_array_set(jv j, int idx, jv val) { - jv_free(val); - return jv_invalid_with_msg(jv_string("Out of bounds negative array index")); - } -+ if (idx > (INT_MAX >> 2) - jvp_array_offset(j)) { -+ jv_free(j); -+ jv_free(val); -+ return jv_invalid_with_msg(jv_string("Array index too large")); -+ } - // copy/free of val,j coalesced - jv* slot = jvp_array_write(&j, idx); - jv_free(*slot); -@@ -1016,6 +1021,7 @@ jv jv_array_concat(jv a, jv b) { - // FIXME: could be faster - jv_array_foreach(b, i, elem) { - a = jv_array_append(a, elem); -+ if (!jv_is_valid(a)) break; - } - jv_free(b); - return a; -@@ -1288,6 +1294,7 @@ jv jv_string_indexes(jv j, jv k) { - p = jstr; - while ((p = _jq_memmem(p, (jstr + jlen) - p, idxstr, idxlen)) != NULL) { - a = jv_array_append(a, jv_number(p - jstr)); -+ if (!jv_is_valid(a)) break; - p++; - } - } -@@ -1336,14 +1343,17 @@ jv jv_string_split(jv j, jv sep) { - - if (seplen == 0) { - int c; -- while ((jstr = jvp_utf8_next(jstr, jend, &c))) -+ while ((jstr = jvp_utf8_next(jstr, jend, &c))) { - a = jv_array_append(a, jv_string_append_codepoint(jv_string(""), c)); -+ if (!jv_is_valid(a)) break; -+ } - } else { - for (p = jstr; p < jend; p = s + seplen) { - s = _jq_memmem(p, jend - p, sepstr, seplen); - if (s == NULL) - s = jend; - a = jv_array_append(a, jv_string_sized(p, s - p)); -+ if (!jv_is_valid(a)) break; - // Add an empty string to denote that j ends on a sep - if (s + seplen == jend && seplen != 0) - a = jv_array_append(a, jv_string("")); -@@ -1361,8 +1371,10 @@ jv jv_string_explode(jv j) { - const char* end = i + len; - jv a = jv_array_sized(len); - int c; -- while ((i = jvp_utf8_next(i, end, &c))) -+ while ((i = jvp_utf8_next(i, end, &c))) { - a = jv_array_append(a, jv_number(c)); -+ if (!jv_is_valid(a)) break; -+ } - jv_free(j); - return a; - } -@@ -1636,10 +1648,13 @@ static void jvp_object_free(jv o) { - } - } - --static jv jvp_object_rehash(jv object) { -+static int jvp_object_rehash(jv *objectp) { -+ jv object = *objectp; - assert(JVP_HAS_KIND(object, JV_KIND_OBJECT)); - assert(jvp_refcnt_unshared(object.u.ptr)); - int size = jvp_object_size(object); -+ if (size > INT_MAX >> 2) -+ return 0; - jv new_object = jvp_object_new(size * 2); - for (int i=0; ivalue; -+ *valpp = &slot->value; -+ return 1; - } - slot = jvp_object_add_slot(*object, key, bucket); - if (slot) { - slot->value = jv_invalid(); - } else { -- *object = jvp_object_rehash(*object); -+ if (!jvp_object_rehash(object)) { -+ *valpp = NULL; -+ return 0; -+ } - bucket = jvp_object_find_bucket(*object, key); - assert(!jvp_object_find_slot(*object, key, bucket)); - slot = jvp_object_add_slot(*object, key, bucket); - assert(slot); - slot->value = jv_invalid(); - } -- return &slot->value; -+ *valpp = &slot->value; -+ return 1; - } - - static int jvp_object_delete(jv* object, jv key) { -@@ -1801,7 +1822,11 @@ jv jv_object_set(jv object, jv key, jv value) { - assert(JVP_HAS_KIND(object, JV_KIND_OBJECT)); - assert(JVP_HAS_KIND(key, JV_KIND_STRING)); - // copy/free of object, key, value coalesced -- jv* slot = jvp_object_write(&object, key); -+ jv* slot; -+ if (!jvp_object_write(&object, key, &slot)) { -+ jv_free(object); -+ return jv_invalid_with_msg(jv_string("Object too big")); -+ } - jv_free(*slot); - *slot = value; - return object; -@@ -1826,6 +1851,7 @@ jv jv_object_merge(jv a, jv b) { - assert(JVP_HAS_KIND(a, JV_KIND_OBJECT)); - jv_object_foreach(b, k, v) { - a = jv_object_set(a, k, v); -+ if (!jv_is_valid(a)) break; - } - jv_free(b); - return a; -@@ -1845,6 +1871,7 @@ jv jv_object_merge_recursive(jv a, jv b) { - jv_free(elem); - a = jv_object_set(a, k, v); - } -+ if (!jv_is_valid(a)) break; - } - jv_free(b); - return a; -diff --git a/src/jv_aux.c b/src/jv_aux.c -index 6004799..bbe1c0d 100644 ---- a/src/jv_aux.c -+++ b/src/jv_aux.c -@@ -193,18 +193,19 @@ jv jv_set(jv t, jv k, jv v) { - if (slice_len < insert_len) { - // array is growing - int shift = insert_len - slice_len; -- for (int i = array_len - 1; i >= end; i--) { -+ for (int i = array_len - 1; i >= end && jv_is_valid(t); i--) { - t = jv_array_set(t, i + shift, jv_array_get(jv_copy(t), i)); - } - } else if (slice_len > insert_len) { - // array is shrinking - int shift = slice_len - insert_len; -- for (int i = end; i < array_len; i++) { -+ for (int i = end; i < array_len && jv_is_valid(t); i++) { - t = jv_array_set(t, i - shift, jv_array_get(jv_copy(t), i)); - } -- t = jv_array_slice(t, 0, array_len - shift); -+ if (jv_is_valid(t)) -+ t = jv_array_slice(t, 0, array_len - shift); - } -- for (int i=0; i < insert_len; i++) { -+ for (int i = 0; i < insert_len && jv_is_valid(t); i++) { - t = jv_array_set(t, start + i, jv_array_get(jv_copy(v), i)); - } - jv_free(v); -diff --git a/tests/jq.test b/tests/jq.test -index 97835f2..10b20e3 100644 ---- a/tests/jq.test -+++ b/tests/jq.test -@@ -198,6 +198,10 @@ null - [0,1,2] - [0,5,2] - -+try (.[999999999] = 0) catch . -+null -+"Array index too large" -+ - # - # Multiple outputs, iteration - # --- -2.49.0 - diff --git a/pkgs/by-name/jq/jq/0005-Fix-heap-buffer-overflow-when-formatting-an-empty-st.patch b/pkgs/by-name/jq/jq/0005-Fix-heap-buffer-overflow-when-formatting-an-empty-st.patch deleted file mode 100644 index 219207f0fe23..000000000000 --- a/pkgs/by-name/jq/jq/0005-Fix-heap-buffer-overflow-when-formatting-an-empty-st.patch +++ /dev/null @@ -1,45 +0,0 @@ -From d73a79035e1d24011a3363d52bf36b4eaea67aa6 Mon Sep 17 00:00:00 2001 -From: itchyny -Date: Sat, 31 May 2025 11:46:40 +0900 -Subject: [PATCH 5/5] Fix heap buffer overflow when formatting an empty string - -The `jv_string_empty` did not properly null-terminate the string data, -which could lead to a heap buffer overflow. The test case of -GHSA-p7rr-28xf-3m5w (`0[""*0]`) was fixed by the commit dc849e9bb74a, -but another case (`0[[]|implode]`) was still vulnerable. This commit -ensures string data is properly null-terminated, and fixes CVE-2025-48060. ---- - src/jv.c | 1 + - tests/jq.test | 4 ++++ - 2 files changed, 5 insertions(+) - -diff --git a/src/jv.c b/src/jv.c -index 6e8cdd3..3303286 100644 ---- a/src/jv.c -+++ b/src/jv.c -@@ -1121,6 +1121,7 @@ static jv jvp_string_empty_new(uint32_t length) { - jvp_string* s = jvp_string_alloc(length); - s->length_hashed = 0; - memset(s->data, 0, length); -+ s->data[length] = 0; - jv r = {JVP_FLAGS_STRING, 0, 0, 0, {&s->refcnt}}; - return r; - } -diff --git a/tests/jq.test b/tests/jq.test -index 10b20e3..680706b 100644 ---- a/tests/jq.test -+++ b/tests/jq.test -@@ -2042,6 +2042,10 @@ map(try implode catch .) - [123,["a"],[nan]] - ["implode input must be an array","string (\"a\") can't be imploded, unicode codepoint needs to be numeric","number (null) can't be imploded, unicode codepoint needs to be numeric"] - -+try 0[implode] catch . -+[] -+"Cannot index number with string \"\"" -+ - # walk - walk(.) - {"x":0} --- -2.49.0 - diff --git a/pkgs/by-name/jq/jq/package.nix b/pkgs/by-name/jq/jq/package.nix index 8e6928be7fbb..074e24725fc6 100644 --- a/pkgs/by-name/jq/jq/package.nix +++ b/pkgs/by-name/jq/jq/package.nix @@ -7,16 +7,19 @@ bison, onigurumaSupport ? true, oniguruma, + tzdata, + nix-update-script, + testers, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "jq"; - version = "1.7.1"; + version = "1.8.0"; # Note: do not use fetchpatch or fetchFromGitHub to keep this package available in __bootPackages src = fetchurl { - url = "https://github.com/jqlang/jq/releases/download/jq-${version}/jq-${version}.tar.gz"; - hash = "sha256-R4ycoSn9LjRD/icxS0VeIR4NjGC8j/ffcDhz3u7lgMI="; + url = "https://github.com/jqlang/jq/releases/download/jq-${finalAttrs.version}/jq-${finalAttrs.version}.tar.gz"; + hash = "sha256-kYEVd/kdmmGV/1DCv/7JtyyEKdwF7D6gIv2VwG0rMZw="; }; outputs = [ @@ -27,30 +30,6 @@ stdenv.mkDerivation rec { "out" ]; - patches = [ - # can't fetchpatch because jq is in bootstrap for darwin - # CVE-2025-48060 - # https://github.com/jqlang/jq/commit/dc849e9bb74a7a164a3ea52f661cc712b1ffbd43 - ./0001-Improve-performance-of-repeating-strings-3272.patch - - # needed for the other patches to apply correctly - # https://github.com/jqlang/jq/commit/b86ff49f46a4a37e5a8e75a140cb5fd6e1331384 - ./0002-fix-jv_number_value-should-cache-the-double-value-of.patch - - # CVE-2024-53427 - # https://github.com/jqlang/jq/commit/a09a4dfd55e6c24d04b35062ccfe4509748b1dd3 - ./0003-Reject-NaN-with-payload-while-parsing-JSON.patch - - # CVE-2024-23337 - # https://github.com/jqlang/jq/commit/de21386681c0df0104a99d9d09db23a9b2a78b1e - ./0004-Fix-signed-integer-overflow-in-jvp_array_write-and-j.patch - - # CVE-2025-48060, part two - # Improve-performance-of-repeating-strings is only a partial fix - # https://github.com/jqlang/jq/commit/c6e041699d8cd31b97375a2596217aff2cfca85b - ./0005-Fix-heap-buffer-overflow-when-formatting-an-empty-st.patch - ]; - # https://github.com/jqlang/jq/issues/2871 postPatch = lib.optionalString stdenv.hostPlatform.isFreeBSD '' substituteInPlace Makefile.am --replace-fail "tests/mantest" "" --replace-fail "tests/optionaltest" "" @@ -61,16 +40,19 @@ stdenv.mkDerivation rec { # doesn't keep. preConfigure = '' echo "#!/bin/sh" > scripts/version - echo "echo ${version}" >> scripts/version + echo "echo ${finalAttrs.version}" >> scripts/version patchShebangs scripts/version ''; # paranoid mode: make sure we never use vendored version of oniguruma # Note: it must be run after automake, or automake will complain preBuild = '' - rm -r ./modules/oniguruma + rm -r ./vendor/oniguruma ''; + strictDeps = true; + enableParallelBuilding = true; + buildInputs = lib.optionals onigurumaSupport [ oniguruma ]; nativeBuildInputs = [ removeReferencesTo @@ -87,9 +69,7 @@ stdenv.mkDerivation rec { ] ++ lib.optional (!onigurumaSupport) "--with-oniguruma=no" # jq is linked to libjq: - ++ lib.optional (!stdenv.hostPlatform.isDarwin) "LDFLAGS=-Wl,-rpath,\\\${libdir}" - # https://github.com/jqlang/jq/issues/3252 - ++ lib.optional stdenv.hostPlatform.isOpenBSD "CFLAGS=-D_BSD_SOURCE=1"; + ++ lib.optional (!stdenv.hostPlatform.isDarwin) "LDFLAGS=-Wl,-rpath,\\\${libdir}"; # jq binary includes the whole `configureFlags` in: # https://github.com/jqlang/jq/commit/583e4a27188a2db097dd043dd203b9c106bba100 @@ -106,24 +86,42 @@ stdenv.mkDerivation rec { doInstallCheck = true; installCheckTarget = "check"; + preInstallCheck = '' + substituteInPlace tests/shtest \ + --replace-fail "TZ=" "TZ=${tzdata}/share/zoneinfo/" + ''; + postInstallCheck = '' - $bin/bin/jq --help >/dev/null $bin/bin/jq -r '.values[1]' <<< '{"values":["hello","world"]}' | grep '^world$' > /dev/null ''; - passthru = { inherit onigurumaSupport; }; + passthru = { + inherit onigurumaSupport; + tests.version = testers.testVersion { + package = lib.getBin finalAttrs.finalPackage; + command = "jq --version"; + }; - meta = with lib; { + updateScript = nix-update-script { + extraArgs = [ + "--version-regex" + "jq-(.+)" + ]; + }; + }; + + meta = { + changelog = "https://github.com/jqlang/jq/releases/tag/jq-${finalAttrs.version}"; description = "Lightweight and flexible command-line JSON processor"; homepage = "https://jqlang.github.io/jq/"; - license = licenses.mit; - maintainers = with maintainers; [ + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ raskin artturin ncfavier ]; - platforms = platforms.unix; + platforms = lib.platforms.unix; downloadPage = "https://jqlang.github.io/jq/download/"; mainProgram = "jq"; }; -} +}) diff --git a/pkgs/by-name/li/libarchive/package.nix b/pkgs/by-name/li/libarchive/package.nix index 526979f9cedb..44e6f482dbe4 100644 --- a/pkgs/by-name/li/libarchive/package.nix +++ b/pkgs/by-name/li/libarchive/package.nix @@ -74,6 +74,7 @@ stdenv.mkDerivation (finalAttrs: { # the filesystem does not necessarily have hardlink capabilities "libarchive/test/test_write_disk_hardlink.c" # access-time-related tests flakey on some systems + "libarchive/test/test_read_disk_directory_traversals.c" "cpio/test/test_option_a.c" "cpio/test/test_option_t.c" ] diff --git a/pkgs/by-name/li/libavif/package.nix b/pkgs/by-name/li/libavif/package.nix index 79640fb74d30..240a16e0975f 100644 --- a/pkgs/by-name/li/libavif/package.nix +++ b/pkgs/by-name/li/libavif/package.nix @@ -2,7 +2,6 @@ lib, stdenv, fetchFromGitHub, - fetchpatch, libaom, cmake, pkg-config, @@ -32,29 +31,15 @@ in stdenv.mkDerivation rec { pname = "libavif"; - version = "1.2.1"; + version = "1.3.0"; src = fetchFromGitHub { owner = "AOMediaCodec"; repo = "libavif"; rev = "v${version}"; - hash = "sha256-cT8Q/VEJ+r971cbuZX92Gf6UX2kMOyZd4Cs2xMxS0Tw="; + hash = "sha256-0J56wpXa2AVh9JUp5UY2kzWijNE3i253RKhpG5oDFJE="; }; - # Adjust some tests to pass on aarch64 - # FIXME: remove in next update - patches = [ - (fetchpatch { - url = "https://github.com/AOMediaCodec/libavif/commit/1e9ef51f32fa23bd7a94d8c01d5205334bc9c52f.patch"; - hash = "sha256-4V7NpuJ+YNm103RMO47TIZaApTm3S6c5RKsjLZFNwYw="; - }) - - (fetchpatch { - url = "https://github.com/AOMediaCodec/libavif/commit/0f1618a25c5eba41b6fec947207d0a32ae3cc6c5.patch"; - hash = "sha256-ORNhD4QtHmBcOYSajnZn7QMfRC3MF4rgUin/Vw+2ztA="; - }) - ]; - postPatch = '' substituteInPlace contrib/gdk-pixbuf/avif.thumbnailer.in \ --replace-fail '@CMAKE_INSTALL_FULL_BINDIR@/gdk-pixbuf-thumbnailer' "$out/libexec/gdk-pixbuf-thumbnailer-avif" diff --git a/pkgs/by-name/li/libdeflate/package.nix b/pkgs/by-name/li/libdeflate/package.nix index f655b4019349..d05c7ec64845 100644 --- a/pkgs/by-name/li/libdeflate/package.nix +++ b/pkgs/by-name/li/libdeflate/package.nix @@ -11,13 +11,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "libdeflate"; - version = "1.23"; + version = "1.24"; src = fetchFromGitHub { owner = "ebiggers"; repo = "libdeflate"; rev = "v${finalAttrs.version}"; - hash = "sha256-bucVkRgZdzLe2HFzIP+Trq4+FJ5kLYdIVNUiJ2f52zg="; + hash = "sha256-IaXXm9VrZ0Pgb3yTh1fPKkifJDvCxvCfTH08Sdho0Ko="; }; cmakeFlags = [ diff --git a/pkgs/by-name/li/libfido2/package.nix b/pkgs/by-name/li/libfido2/package.nix index 69c6eae7acb1..60c41b852445 100644 --- a/pkgs/by-name/li/libfido2/package.nix +++ b/pkgs/by-name/li/libfido2/package.nix @@ -16,12 +16,12 @@ stdenv.mkDerivation rec { pname = "libfido2"; - version = "1.15.0"; + version = "1.16.0"; # releases on https://developers.yubico.com/libfido2/Releases/ are signed src = fetchurl { url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz"; - hash = "sha256-q6qxMY0h0mLs5Bb7inEy+pN0vaifb6UrhqmKL1cSth4="; + hash = "sha256-jCtvsnm1tC6aySrecYMuSFhSZHtTYHxDuqr7vOzqBOQ="; }; nativeBuildInputs = [ diff --git a/pkgs/by-name/li/libraw/package.nix b/pkgs/by-name/li/libraw/package.nix index b16a69fea358..f47a7c5b0119 100644 --- a/pkgs/by-name/li/libraw/package.nix +++ b/pkgs/by-name/li/libraw/package.nix @@ -15,13 +15,13 @@ stdenv.mkDerivation rec { pname = "libraw"; - version = "0.21.3"; + version = "0.21.4"; src = fetchFromGitHub { owner = "LibRaw"; repo = "LibRaw"; rev = version; - hash = "sha256-QFyRQ0V7din/rnkRvEWf521kSzN7HwJ3kZiQ43PAmVI="; + hash = "sha256-JAGIM7A9RbK22F8KczRcb+29t4fDDXzoCA3a4s/z6Q8="; }; outputs = [ @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { ''; passthru.tests = { - inherit imagemagick hdrmerge freeimage; + inherit imagemagick hdrmerge; # freeimage inherit (python3.pkgs) rawkit; }; diff --git a/pkgs/by-name/li/libtheora/package.nix b/pkgs/by-name/li/libtheora/package.nix index 63a7096e8c8d..74c5b0691a9a 100644 --- a/pkgs/by-name/li/libtheora/package.nix +++ b/pkgs/by-name/li/libtheora/package.nix @@ -1,11 +1,12 @@ { lib, stdenv, - fetchurl, + fetchFromGitHub, autoreconfHook, libogg, libvorbis, pkg-config, + perl, testers, validatePkgConfig, }: @@ -14,13 +15,19 @@ stdenv.mkDerivation (finalAttrs: { pname = "libtheora"; version = "1.2.0"; - src = fetchurl { - url = "https://downloads.xiph.org/releases/theora/libtheora-${finalAttrs.version}.tar.gz"; - hash = "sha256-J5MnM5kDtUTCipKurafQ3P0Dl7WcLzaMxpisVvUVkG4="; + src = fetchFromGitHub { + owner = "xiph"; + repo = "theora"; + tag = "v${finalAttrs.version}"; + hash = "sha256-kzZh4V6wZX9MetDutuqjRenmdpy4PHaRU9MgtIwPpiU="; }; patches = lib.optionals stdenv.hostPlatform.isMinGW [ ./mingw-remove-export.patch ]; + postPatch = lib.optionalString stdenv.hostPlatform.isArmv7 '' + patchShebangs lib/arm/arm2gnu.pl + ''; + configureFlags = [ "--disable-examples" ]; outputs = [ @@ -30,17 +37,24 @@ stdenv.mkDerivation (finalAttrs: { ]; outputDoc = "devdoc"; - nativeBuildInputs = [ - autoreconfHook - pkg-config - validatePkgConfig - ]; + nativeBuildInputs = + [ + autoreconfHook + pkg-config + validatePkgConfig + ] + ++ lib.optionals stdenv.hostPlatform.isArmv7 [ + # Needed to run lib/arm/arm2gnu.pl for ARM assembly optimizations + perl + ]; propagatedBuildInputs = [ libogg libvorbis ]; + strictDeps = true; + passthru = { tests.pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; diff --git a/pkgs/by-name/li/libusb1/package.nix b/pkgs/by-name/li/libusb1/package.nix index 004ac429328a..4ec95125a008 100644 --- a/pkgs/by-name/li/libusb1/package.nix +++ b/pkgs/by-name/li/libusb1/package.nix @@ -16,13 +16,13 @@ stdenv.mkDerivation rec { pname = "libusb"; - version = "1.0.28"; + version = "1.0.29"; src = fetchFromGitHub { owner = "libusb"; repo = "libusb"; rev = "v${version}"; - sha256 = "sha256-ntfDh/+HYm5cthhO8FkAJHo4RcxvZUKmHf4AOrHLysM="; + sha256 = "sha256-m1w+uF8+2WCn72LvoaGUYa+R0PyXHtFFONQjdRfImYY="; }; outputs = [ diff --git a/pkgs/by-name/li/libuv/package.nix b/pkgs/by-name/li/libuv/package.nix index ccbcfc939ed6..949fb489eb23 100644 --- a/pkgs/by-name/li/libuv/package.nix +++ b/pkgs/by-name/li/libuv/package.nix @@ -134,6 +134,8 @@ stdenv.mkDerivation (finalAttrs: { # EOPNOTSUPP when performed in jailed build env "tcp_reuseport" "udp_reuseport" + # jailed build env does not have a hostname + "gethostname" # Fails when built on non-nix FreeBSD # https://github.com/libuv/libuv/issues/4606 "fs_event_watch_delete_dir" @@ -142,6 +144,8 @@ stdenv.mkDerivation (finalAttrs: { in lib.optionalString (finalAttrs.finalPackage.doCheck) '' sed '/${tdRegexp}/d' -i test/test-list.h + # https://github.com/libuv/libuv/issues/4794 + substituteInPlace Makefile.am --replace-fail -lutil "-lutil -lm" ''; nativeBuildInputs = [ diff --git a/pkgs/by-name/li/libzip/package.nix b/pkgs/by-name/li/libzip/package.nix index 6c6cbc95c7fc..042c745ce9d6 100644 --- a/pkgs/by-name/li/libzip/package.nix +++ b/pkgs/by-name/li/libzip/package.nix @@ -19,11 +19,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "libzip"; - version = "1.11.3"; + version = "1.11.4"; src = fetchurl { url = "https://libzip.org/download/libzip-${finalAttrs.version}.tar.gz"; - hash = "sha256-dmU/E13eMDYDbFAOEYYWSP+/nh/FsjP/RzxgiX2dsOo="; + hash = "sha256-guny8kIfnXwkZrvDFzzQlZWojqN9sNVZqdCi3GDcci4="; }; outputs = [ diff --git a/pkgs/by-name/ln/lndir/package.nix b/pkgs/by-name/ln/lndir/package.nix new file mode 100644 index 000000000000..9e18819a4947 --- /dev/null +++ b/pkgs/by-name/ln/lndir/package.nix @@ -0,0 +1,59 @@ +{ + lib, + stdenv, + fetchurl, + updateAutotoolsGnuConfigScriptsHook, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "lndir"; + version = "1.0.5"; + + src = fetchurl { + url = "mirror://xorg/individual/util/lndir-${finalAttrs.version}.tar.xz"; + hash = "sha256-O2VXelV1zOCVZk9UkhZKlpQYAP5ikKEjcx1H8+cQTds="; + }; + + strictDeps = true; + + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; + + preConfigure = '' + # removes dependency on xorgproto + # from commit 466f1d85d21f79237123d74598a3d7f073513685 + # also fix build due to missing import of unistd.h + export XPROTO_CFLAGS=" " + export XPROTO_LIBS=" " + substituteInPlace lndir.c \ + --replace-fail '' "" \ + --replace-fail '#include ' "" \ + --replace-fail '_X_ATTRIBUTE_PRINTF(1,2)' '__attribute__((__format__(__printf__,1,2)))' \ + --replace-fail '_X_ATTRIBUTE_PRINTF(2,3)' '__attribute__((__format__(__printf__,2,3)))' \ + --replace-fail '_X_NORETURN' '__attribute__((noreturn))' + + # supposed to make lndir it work on directories with st_nlink set to 1 (such as on btrfs). + # from commit 26164c05c5a227462e8f076db6018a4c55fa1412 + substituteInPlace lndir.c \ + --replace-fail 'n_dirs--;' "" + ''; + + passthru = { + updateScript = writeScript "update-${finalAttrs.pname}" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts + version="$(list-directory-versions --pname ${finalAttrs.pname} \ + --url https://xorg.freedesktop.org/releases/individual/util/ \ + | sort -V | tail -n1)" + update-source-version ${finalAttrs.pname} "$version" + ''; + }; + + meta = { + description = "Create a shadow directory of symbolic links to another directory tree"; + homepage = "https://gitlab.freedesktop.org/xorg/util/lndir"; + license = lib.licenses.mitOpenGroup; + mainProgram = "lndir"; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/by-name/mp/mpdecimal/package.nix b/pkgs/by-name/mp/mpdecimal/package.nix index 72a3ece43fbb..4a66cc35d719 100644 --- a/pkgs/by-name/mp/mpdecimal/package.nix +++ b/pkgs/by-name/mp/mpdecimal/package.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { pname = "mpdecimal"; - version = "4.0.0"; + version = "4.0.1"; outputs = [ "out" "cxx" @@ -17,18 +17,12 @@ stdenv.mkDerivation rec { src = fetchurl { url = "https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-${version}.tar.gz"; - hash = "sha256-lCRFwyRbInMP1Bpnp8XCMdEcsbmTa5wPdjNPt9C0Row="; + hash = "sha256-ltM6u0uwBwx74P7UJGzThBYYgyX4IEaCFEcZOFRbGsg="; }; nativeBuildInputs = [ autoreconfHook ]; - configureFlags = [ "LD=${stdenv.cc.targetPrefix}cc" ]; - - postPatch = '' - # Use absolute library install names on Darwin. - substituteInPlace configure.ac \ - --replace-fail '-install_name @rpath/' "-install_name $out/lib/" - ''; + enableParallelBuilding = true; postInstall = '' mkdir -p $cxx/lib diff --git a/pkgs/by-name/pi/pixman/package.nix b/pkgs/by-name/pi/pixman/package.nix index 94d742f374e3..0846cd93bbdf 100644 --- a/pkgs/by-name/pi/pixman/package.nix +++ b/pkgs/by-name/pi/pixman/package.nix @@ -25,14 +25,14 @@ stdenv.mkDerivation (finalAttrs: { pname = "pixman"; - version = "0.44.2"; + version = "0.46.0"; src = fetchurl { urls = with finalAttrs; [ "mirror://xorg/individual/lib/${pname}-${version}.tar.gz" "https://cairographics.org/releases/${pname}-${version}.tar.gz" ]; - hash = "sha256-Y0kGHOGjOKtpUrkhlNGwN3RyJEII1H/yW++G/HGXNGY="; + hash = "sha256-Atn/e4RY72FzHD01X4VLv0Yf0KTTVjxR8cHHsAY4BQ0="; }; # Raise test timeout, 120s can be slightly exceeded on slower hardware diff --git a/pkgs/by-name/re/re2c/package.nix b/pkgs/by-name/re/re2c/package.nix index bc7ee4beba24..5442dd079c5a 100644 --- a/pkgs/by-name/re/re2c/package.nix +++ b/pkgs/by-name/re/re2c/package.nix @@ -14,13 +14,13 @@ stdenv.mkDerivation rec { pname = "re2c"; - version = "4.1"; + version = "4.2"; src = fetchFromGitHub { owner = "skvadrik"; repo = "re2c"; rev = version; - sha256 = "sha256-xB4oH0QS0VKTK2we+wdylS8VBijpp6tv7YV7fIX1s4A="; + hash = "sha256-7Niq+Xxq/r86qOeJl6/gNdH1XKm6m0fPhbPmgazZFkU="; }; nativeBuildInputs = [ diff --git a/pkgs/by-name/s2/s2n-tls/package.nix b/pkgs/by-name/s2/s2n-tls/package.nix index 51e84aaf2c3b..5be03f547157 100644 --- a/pkgs/by-name/s2/s2n-tls/package.nix +++ b/pkgs/by-name/s2/s2n-tls/package.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation rec { pname = "s2n-tls"; - version = "1.5.17"; + version = "1.5.20"; src = fetchFromGitHub { owner = "aws"; repo = "s2n-tls"; rev = "v${version}"; - hash = "sha256-ylaWeYLplAi94PQHauI1lG4PJI193TvrAPM7U446cnE="; + hash = "sha256-qmwo8GZpOtAs3OgdR9DWnOGz8sQcGqZKZn4WwfGpy6M="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/by-name/sd/sdl2-compat/package.nix b/pkgs/by-name/sd/sdl2-compat/package.nix index 03f76b78e462..20783cab0638 100644 --- a/pkgs/by-name/sd/sdl2-compat/package.nix +++ b/pkgs/by-name/sd/sdl2-compat/package.nix @@ -21,7 +21,11 @@ ffmpeg, qemu, }: - +let + # tray support on sdl3 pulls in gtk3, which is quite an expensive dependency. + # sdl2 does not support the tray, so we can just disable that requirement. + sdl3' = sdl3.override { traySupport = false; }; +in stdenv.mkDerivation (finalAttrs: { pname = "sdl2-compat"; version = "2.32.56"; @@ -39,7 +43,7 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - sdl3 + sdl3' libX11 ]; @@ -57,7 +61,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ (lib.cmakeBool "SDL2COMPAT_TESTS" finalAttrs.finalPackage.doCheck) - (lib.cmakeFeature "CMAKE_INSTALL_RPATH" (lib.makeLibraryPath [ sdl3 ])) + (lib.cmakeFeature "CMAKE_INSTALL_RPATH" (lib.makeLibraryPath [ sdl3' ])) ]; # skip timing-based tests as those are flaky diff --git a/pkgs/by-name/sd/sdl3/package.nix b/pkgs/by-name/sd/sdl3/package.nix index 604a9427541a..236e0c69af41 100644 --- a/pkgs/by-name/sd/sdl3/package.nix +++ b/pkgs/by-name/sd/sdl3/package.nix @@ -8,7 +8,7 @@ darwinMinVersionHook, dbus, fetchFromGitHub, - ibus, + ibusMinimal, installShellFiles, libGL, libayatana-appindicator, @@ -51,6 +51,7 @@ libudevSupport ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAndroid, sndioSupport ? false, testSupport ? true, + traySupport ? true, waylandSupport ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAndroid, x11Support ? !stdenv.hostPlatform.isAndroid && !stdenv.hostPlatform.isWindows, }: @@ -58,33 +59,44 @@ assert lib.assertMsg ( waylandSupport -> openglSupport ) "SDL3 requires OpenGL support to enable Wayland"; +assert lib.assertMsg (ibusSupport -> dbusSupport) "SDL3 requires dbus support to enable ibus"; stdenv.mkDerivation (finalAttrs: { pname = "sdl3"; - version = "3.2.14"; + version = "3.2.16"; - outputs = [ - "lib" - "dev" - "out" - ]; + outputs = + [ + "lib" + "dev" + "out" + ] + ++ lib.optionals testSupport [ + "installedTests" + ]; src = fetchFromGitHub { owner = "libsdl-org"; repo = "SDL"; tag = "release-${finalAttrs.version}"; - hash = "sha256-+CcbvF1nxxsVwuO5g50sBVGth0sr5WTFojSfT6B6bok="; + hash = "sha256-xFWE/i4l3sU1KritwbqvN67kJ3/WUfNP3iScMfQUbwA="; }; postPatch = # Tests timeout on Darwin + # `testtray` loads assets from a relative path, which we are patching to be absolute lib.optionalString testSupport '' substituteInPlace test/CMakeLists.txt \ --replace-fail 'set(noninteractive_timeout 10)' 'set(noninteractive_timeout 30)' + + substituteInPlace test/testtray.c \ + --replace-warn '../test/' '${placeholder "installedTests"}/share/assets/' '' + lib.optionalString waylandSupport '' substituteInPlace src/video/wayland/SDL_waylandmessagebox.c \ --replace-fail '"zenity"' '"${lib.getExe zenity}"' + substituteInPlace src/dialog/unix/SDL_zenitydialog.c \ + --replace-fail '"zenity"' '"${lib.getExe zenity}"' ''; strictDeps = true; @@ -104,7 +116,11 @@ stdenv.mkDerivation (finalAttrs: { apple-sdk_11 ] ++ lib.optionals ibusSupport [ - ibus + # sdl3 only uses some constants of the ibus headers + # it never actually loads the library + # thus, it also does not have to care about gtk integration, + # so using ibusMinimal avoids an unnecessarily large closure here. + ibusMinimal ] ++ lib.optional waylandSupport zenity; @@ -113,7 +129,7 @@ stdenv.mkDerivation (finalAttrs: { libusb1 ] ++ lib.optional ( - stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isDarwin + stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isDarwin && traySupport ) libayatana-appindicator ++ lib.optional alsaSupport alsa-lib ++ lib.optional dbusSupport dbus @@ -160,11 +176,13 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "SDL_PULSEAUDIO" pulseaudioSupport) (lib.cmakeBool "SDL_SNDIO" sndioSupport) (lib.cmakeBool "SDL_TEST_LIBRARY" testSupport) + (lib.cmakeBool "SDL_TRAY_DUMMY" (!traySupport)) (lib.cmakeBool "SDL_WAYLAND" waylandSupport) (lib.cmakeBool "SDL_WAYLAND_LIBDECOR" libdecorSupport) (lib.cmakeBool "SDL_X11" x11Support) (lib.cmakeBool "SDL_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "SDL_INSTALL_TESTS" testSupport) ]; doCheck = testSupport && stdenv.buildPlatform.canExecute stdenv.hostPlatform; @@ -180,6 +198,12 @@ stdenv.mkDerivation (finalAttrs: { ) "-rpath ${lib.makeLibraryPath (finalAttrs.dlopenBuildInputs)}"; }; + postInstall = lib.optionalString testSupport '' + moveToOutput "share/installed-tests" "$installedTests" + moveToOutput "libexec/installed-tests" "$installedTests" + install -Dm 444 -t $installedTests/share/assets test/*.bmp + ''; + passthru = { # Building this in its own derivation to make sure the rpath hack above propagate to users debug-text-example = stdenv.mkDerivation (finalAttrs': { diff --git a/pkgs/by-name/se/sessreg/package.nix b/pkgs/by-name/se/sessreg/package.nix new file mode 100644 index 000000000000..1cbad96cd6e3 --- /dev/null +++ b/pkgs/by-name/se/sessreg/package.nix @@ -0,0 +1,45 @@ +{ + lib, + stdenv, + fetchurl, + pkg-config, + xorgproto, + writeScript, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "sessreg"; + version = "1.1.3"; + + src = fetchurl { + url = "mirror://xorg/individual/app/sessreg-${finalAttrs.version}.tar.xz"; + hash = "sha256-AirNXegHfd3E+RmWH3nhAuzV8yKKMzaBr1zQ5zRPrMI="; + }; + + strictDeps = true; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ xorgproto ]; + + passthru = { + updateScript = writeScript "update-${finalAttrs.pname}" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts + version="$(list-directory-versions --pname ${finalAttrs.pname} \ + --url https://xorg.freedesktop.org/releases/individual/app/ \ + | sort -V | tail -n1)" + update-source-version ${finalAttrs.pname} "$version" + ''; + }; + + meta = { + description = "Utility to manage utmp & wtmp entries for X sessions"; + homepage = "https://gitlab.freedesktop.org/xorg/app/sessreg"; + license = with lib.licenses; [ + mitOpenGroup + mit + ]; + mainProgram = "sessreg"; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/by-name/so/softhsm/package.nix b/pkgs/by-name/so/softhsm/package.nix index 48d64a0935d2..19be262667a4 100644 --- a/pkgs/by-name/so/softhsm/package.nix +++ b/pkgs/by-name/so/softhsm/package.nix @@ -22,6 +22,9 @@ stdenv.mkDerivation rec { "--with-objectstore-backend-db" "--sysconfdir=$out/etc" "--localstatedir=$out/var" + # The configure script checks for the sqlite3 command, but never uses it. + # Provide an arbitrary executable file for cross scenarios. + "ac_cv_path_SQLITE3=/" ]; buildInputs = [ @@ -29,6 +32,8 @@ stdenv.mkDerivation rec { sqlite ]; + strictDeps = true; + postInstall = "rm -rf $out/var"; meta = with lib; { diff --git a/pkgs/by-name/sw/swig/package.nix b/pkgs/by-name/sw/swig/package.nix index fe1f55ce5c94..b247de5da3e2 100644 --- a/pkgs/by-name/sw/swig/package.nix +++ b/pkgs/by-name/sw/swig/package.nix @@ -11,13 +11,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "swig"; - version = "4.3.0"; + version = "4.3.1"; src = fetchFromGitHub { owner = "swig"; repo = "swig"; rev = "v${finalAttrs.version}"; - hash = "sha256-hFHEE9wy8Lja9G396tI4fj4LhOkpPKJkDuy1L62AXr4="; + hash = "sha256-wEqbKDgXVU8kQxdh7uC+EZ0u5leeoYh2d/61qB4guOg="; }; strictDeps = true; @@ -41,6 +41,8 @@ stdenv.mkDerivation (finalAttrs: { ./autogen.sh ''; + enableParallelBuilding = true; + meta = { changelog = "https://github.com/swig/swig/blob/${finalAttrs.src.rev}/CHANGES.current"; description = "Interface compiler that connects C/C++ code to higher-level languages"; diff --git a/pkgs/by-name/va/valgrind/package.nix b/pkgs/by-name/va/valgrind/package.nix index c180de124d6b..91a4196fcf63 100644 --- a/pkgs/by-name/va/valgrind/package.nix +++ b/pkgs/by-name/va/valgrind/package.nix @@ -11,20 +11,14 @@ stdenv.mkDerivation rec { pname = "valgrind"; - version = "3.24.0"; + version = "3.25.1"; src = fetchurl { url = "https://sourceware.org/pub/${pname}/${pname}-${version}.tar.bz2"; - hash = "sha256-ca7iAr3vGuc4mMz36cMVE0+n22wkYGOvxQOu9wLsA70="; + hash = "sha256-Yd640HJ7RcJo79wbO2yeZ5zZfL9e5LKNHerXyLeica8="; }; patches = [ - # Fix build on ELFv2 powerpc64 - # https://bugs.kde.org/show_bug.cgi?id=398883 - (fetchurl { - url = "https://github.com/void-linux/void-packages/raw/3e16b4606235885463fc9ab45b4c120f1a51aa28/srcpkgs/valgrind/patches/elfv2-ppc64-be.patch"; - sha256 = "NV/F+5aqFZz7+OF5oN5MUTpThv4H5PEY9sBgnnWohQY="; - }) # Fix checks on Musl. # https://bugs.kde.org/show_bug.cgi?id=453929 (fetchpatch { diff --git a/pkgs/by-name/ve/versionCheckHook/hook.sh b/pkgs/by-name/ve/versionCheckHook/hook.sh index 436032b0a97d..ac4605640b70 100644 --- a/pkgs/by-name/ve/versionCheckHook/hook.sh +++ b/pkgs/by-name/ve/versionCheckHook/hook.sh @@ -1,10 +1,19 @@ _handleCmdOutput(){ local command=("$1" "$2") local versionOutput + + local envArgs=() + if [[ "$3" != "*" ]]; then + envArgs+=("--ignore-environment") + for var in $3; do + envArgs+=("$var=${!var}") + done + fi + versionOutput="$(env \ --chdir=/ \ --argv0="$(basename "${command[0]}")" \ - $( [[ -z "$3" || "$3" = "0" ]] && echo --ignore-environment ) \ + "${envArgs[@]}" \ "${command[@]}" 2>&1 \ | sed -e 's|@storeDir@/[^/ ]*/|{{storeDir}}/|g' \ || true)" @@ -25,8 +34,8 @@ versionCheckHook(){ runHook preVersionCheck echo Executing versionCheckPhase - # Enable --ignore-environment by default unless explicitly disabled - : "${versionCheckDontIgnoreEnvironment:=0}" + # Don't keep any environment variables by default + : "${versionCheckKeepEnvironment:=}" local cmdProgram cmdArg echoPrefix if [[ -z "${versionCheckProgram-}" ]]; then @@ -47,14 +56,14 @@ versionCheckHook(){ fi if [[ -z "${versionCheckProgramArg}" ]]; then for cmdArg in "--help" "--version"; do - echoPrefix="$(_handleCmdOutput "$cmdProgram" "$cmdArg" "$versionCheckDontIgnoreEnvironment")" + echoPrefix="$(_handleCmdOutput "$cmdProgram" "$cmdArg" "$versionCheckKeepEnvironment")" if [[ "$echoPrefix" == "Successfully managed to" ]]; then break fi done else cmdArg="$versionCheckProgramArg" - echoPrefix="$(_handleCmdOutput "$cmdProgram" "$cmdArg" "$versionCheckDontIgnoreEnvironment")" + echoPrefix="$(_handleCmdOutput "$cmdProgram" "$cmdArg" "$versionCheckKeepEnvironment")" fi if [[ "$echoPrefix" == "Did not" ]]; then exit 2 diff --git a/pkgs/by-name/vp/vpnc-scripts/package.nix b/pkgs/by-name/vp/vpnc-scripts/package.nix index 4ff2b6d355e2..9be974347412 100644 --- a/pkgs/by-name/vp/vpnc-scripts/package.nix +++ b/pkgs/by-name/vp/vpnc-scripts/package.nix @@ -10,6 +10,7 @@ nettools, openresolv, systemd, + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, }: stdenv.mkDerivation { @@ -36,7 +37,10 @@ stdenv.mkDerivation { '' + lib.optionalString stdenv.hostPlatform.isLinux '' substituteInPlace $out/bin/vpnc-script \ - --replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" \ + --replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" + '' + + lib.optionalString withSystemd '' + substituteInPlace $out/bin/vpnc-script \ --replace "/usr/bin/resolvectl" "${systemd}/bin/resolvectl" '' + '' diff --git a/pkgs/by-name/wa/waf/package.nix b/pkgs/by-name/wa/waf/package.nix index e4a3262a8d12..2902a7fe55ca 100644 --- a/pkgs/by-name/wa/waf/package.nix +++ b/pkgs/by-name/wa/waf/package.nix @@ -64,7 +64,7 @@ stdenv.mkDerivation (finalAttrs: { runHook preInstall install -D waf "$out"/bin/waf - wrapProgram "$out"/bin/waf --set PYTHONPATH "$out"/${python3.sitePackages} + wrapProgram "$out"/bin/waf --prefix PYTHONPATH : "$out"/${python3.sitePackages} mkdir -p "$out"/${python3.sitePackages}/ cp -r waflib "$out"/${python3.sitePackages}/ runHook postInstall diff --git a/pkgs/by-name/xo/xorgproto/package.nix b/pkgs/by-name/xo/xorgproto/package.nix new file mode 100644 index 000000000000..a0766a9979a4 --- /dev/null +++ b/pkgs/by-name/xo/xorgproto/package.nix @@ -0,0 +1,136 @@ +{ + lib, + stdenv, + fetchurl, + fetchpatch, + pkg-config, + python3, + meson, + ninja, + writeScript, + testers, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "xorgproto"; + version = "2024.1"; + + src = fetchurl { + url = "mirror://xorg/individual/proto/xorgproto-${finalAttrs.version}.tar.xz"; + hash = "sha256-NyIl/UCBW4QjVH9diQxd68cuiLkQiPv7ExWMIElcy1k="; + }; + + patches = [ + # small fix for mingw + (fetchpatch { + url = "https://aur.archlinux.org/cgit/aur.git/plain/meson.patch?h=mingw-w64-xorgproto&id=7b817efc3144a50e6766817c4ca7242f8ce49307"; + sha256 = "sha256-Izzz9In53W7CC++k1bLr78iSrmxpFm1cH8qcSpptoUQ="; + }) + ]; + + strictDeps = true; + + nativeBuildInputs = [ + pkg-config + python3 + meson + ninja + ]; + + # adds support for printproto needed for libXp + mesonFlags = [ "-Dlegacy=true" ]; + + passthru = { + updateScript = writeScript "update-${finalAttrs.pname}" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts + version="$(list-directory-versions --pname ${finalAttrs.pname} \ + --url https://xorg.freedesktop.org/releases/individual/proto/ \ + | sort -V | tail -n1)" + update-source-version ${finalAttrs.pname} "$version" + ''; + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; + + meta = { + description = "X Window System unified protocol definitions"; + homepage = "https://gitlab.freedesktop.org/xorg/proto/xorgproto"; + license = with lib.licenses; [ + # The copyright notices are split between each protocol, so to be able to validate this, + # I listed all the components that have the license for each license: + + # applewm, composite, dmx, evie, fixes, input, video, windowswm, x11, xext, xf86dri + mit + # bigreqs, fonts, input, lg3d, pm, x11, xmisc, xext, xinerama + mitOpenGroup + # composite, damage, dri3, fixes, fonts, present, randr, record, render, xext, xwayland + hpndSellVariant + # dri2 + icu + # fontcache + bsd2 + # gl + sgi-b-20 + # fonts, input, kb, trap, video, x11, xext + hpnd + # print, resource, scrnsaver, video, xext, xf86{bigfont,dga,misc,rush,vidmode}, xinerama + # Note: 2 of the licenses actually omit a sentence from the x11 license that is not marked as + # omittable by spdx. But the sentence is not integral to the license's meaning, I think. + x11 + # x11 + hpndDifferentDisclaimer + + # fontsproto and x11proto both contain a license that is almost the X11 license, but with one + # important difference: the sentence "Permission is hereby granted [...] to use, copy, + # modify, merge, publish, distribute ..." is replaced with "All rights reserved." + # Since XFree86 has the copyright and XFree86 was, at least in later releases, free software + # under the X11 license, I will give this the benefit of the doubt and not mark a package + # that idk 30% of nixpkgs depends on (estimate based on nothing other than most xorg stuff + # depends on it) as unfree. + # upstream issue: https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/issues/53 + #unfree + ]; + maintainers = [ ]; + pkgConfigModules = [ + "applewmproto" + "bigreqsproto" + "compositeproto" + "damageproto" + "dmxproto" + "dpmsproto" + "dri2proto" + "dri3proto" + "evieproto" + "fixesproto" + "fontcacheproto" + "fontsproto" + "glproto" + "inputproto" + "kbproto" + "lg3dproto" + "presentproto" + "printproto" + "randrproto" + "recordproto" + "renderproto" + "resourceproto" + "scrnsaverproto" + "trapproto" + "videoproto" + "windowswmproto" + "xcalibrateproto" + "xcmiscproto" + "xextproto" + "xf86bigfontproto" + "xf86dgaproto" + "xf86driproto" + "xf86miscproto" + "xf86rushproto" + "xf86vidmodeproto" + "xineramaproto" + "xproto" + "xproxymngproto" + "xwaylandproto" + ]; + platforms = lib.platforms.unix ++ lib.platforms.windows; + }; +}) diff --git a/pkgs/by-name/xs/xsimd/package.nix b/pkgs/by-name/xs/xsimd/package.nix index a96de8723816..0a3cabfc2969 100644 --- a/pkgs/by-name/xs/xsimd/package.nix +++ b/pkgs/by-name/xs/xsimd/package.nix @@ -2,37 +2,28 @@ lib, stdenv, fetchFromGitHub, - fetchpatch, cmake, doctest, }: stdenv.mkDerivation (finalAttrs: { pname = "xsimd"; - version = "13.0.0"; + version = "13.2.0"; + src = fetchFromGitHub { owner = "xtensor-stack"; repo = "xsimd"; - rev = finalAttrs.version; - hash = "sha256-qElJYW5QDj3s59L3NgZj5zkhnUMzIP2mBa1sPks3/CE="; + tag = finalAttrs.version; + hash = "sha256-L4ttJxP46uNwQAEUMoJ8rsc51Le2GeIGbT1kX7ZzcPA="; }; - patches = - [ - # Fix of https://github.com/xtensor-stack/xsimd/pull/1024 for - # https://github.com/xtensor-stack/xsimd/issues/456 and - # https://github.com/xtensor-stack/xsimd/issues/807, - (fetchpatch { - url = "https://github.com/xtensor-stack/xsimd/commit/c8a87ed6e04b6782f48f94713adfb0cad6c11ddf.patch"; - hash = "sha256-2/FvBGdqTPcayD7rdHPSzL+F8IYKAfMW0WBJ0cW9EZ0="; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # https://github.com/xtensor-stack/xsimd/issues/1030 - ./disable-test_error_gamma.patch - # https://github.com/xtensor-stack/xsimd/issues/1063 - ./relax-asin-precision.diff - ]; + patches = lib.optionals stdenv.hostPlatform.isDarwin [ + # https://github.com/xtensor-stack/xsimd/issues/1030 + ./disable-test_error_gamma.patch + + # https://github.com/xtensor-stack/xsimd/issues/1063 + ./relax-asin-precision.diff + ]; # strictDeps raises the chance that xsimd will be able to be cross compiled strictDeps = true; @@ -54,17 +45,17 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; checkTarget = "xtest"; - meta = with lib; { + meta = { changelog = "https://github.com/xtensor-stack/xsimd/blob/${finalAttrs.version}/Changelog.rst#${ builtins.replaceStrings [ "." ] [ "" ] finalAttrs.version }"; description = "C++ wrappers for SIMD intrinsics"; homepage = "https://github.com/xtensor-stack/xsimd"; - license = licenses.bsd3; - maintainers = with maintainers; [ + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ tobim doronbehar ]; - platforms = platforms.all; + platforms = lib.platforms.all; }; }) diff --git a/pkgs/development/compilers/ghc/8.10.7-binary.nix b/pkgs/development/compilers/ghc/8.10.7-binary.nix index 40becff83767..dd892510f49f 100644 --- a/pkgs/development/compilers/ghc/8.10.7-binary.nix +++ b/pkgs/development/compilers/ghc/8.10.7-binary.nix @@ -388,6 +388,15 @@ stdenv.mkDerivation { # calls install-strip ... dontBuild = true; + # GHC tries to remove xattrs when installing to work around Gatekeeper + # (see https://gitlab.haskell.org/ghc/ghc/-/issues/17418). This step normally + # succeeds in nixpkgs because xattrs are not allowed in the store, but it + # can fail when a file has the `com.apple.provenance` xattr, and it can’t be + # modified (such as target of the symlink to `libiconv.dylib`). + # The `com.apple.provenance` xattr is a new feature of macOS as of macOS 13. + # See: https://eclecticlight.co/2023/03/13/ventura-has-changed-app-quarantine-with-a-new-xattr/ + makeFlags = lib.optionals stdenv.buildPlatform.isDarwin [ "XATTR=/does-not-exist" ]; + # Patch scripts to include runtime dependencies in $PATH. postInstall = '' for i in "$out/bin/"*; do diff --git a/pkgs/development/compilers/ghc/8.6.5-binary.nix b/pkgs/development/compilers/ghc/8.6.5-binary.nix index 4ed8654a0bfa..82d7a11c7183 100644 --- a/pkgs/development/compilers/ghc/8.6.5-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix @@ -178,6 +178,15 @@ stdenv.mkDerivation rec { # calls install-strip ... dontBuild = true; + # GHC tries to remove xattrs when installing to work around Gatekeeper + # (see https://gitlab.haskell.org/ghc/ghc/-/issues/17418). This step normally + # succeeds in nixpkgs because xattrs are not allowed in the store, but it + # can fail when a file has the `com.apple.provenance` xattr, and it can’t be + # modified (such as target of the symlink to `libiconv.dylib`). + # The `com.apple.provenance` xattr is a new feature of macOS as of macOS 13. + # See: https://eclecticlight.co/2023/03/13/ventura-has-changed-app-quarantine-with-a-new-xattr/ + makeFlags = lib.optionals stdenv.buildPlatform.isDarwin [ "XATTR=/does-not-exist" ]; + # Patch scripts to include runtime dependencies in $PATH. postInstall = '' for i in "$out/bin/"*; do diff --git a/pkgs/development/compilers/ghc/9.2.4-binary.nix b/pkgs/development/compilers/ghc/9.2.4-binary.nix index 88b25c420632..fa1119654fee 100644 --- a/pkgs/development/compilers/ghc/9.2.4-binary.nix +++ b/pkgs/development/compilers/ghc/9.2.4-binary.nix @@ -342,6 +342,15 @@ stdenv.mkDerivation { # calls install-strip ... dontBuild = true; + # GHC tries to remove xattrs when installing to work around Gatekeeper + # (see https://gitlab.haskell.org/ghc/ghc/-/issues/17418). This step normally + # succeeds in nixpkgs because xattrs are not allowed in the store, but it + # can fail when a file has the `com.apple.provenance` xattr, and it can’t be + # modified (such as target of the symlink to `libiconv.dylib`). + # The `com.apple.provenance` xattr is a new feature of macOS as of macOS 13. + # See: https://eclecticlight.co/2023/03/13/ventura-has-changed-app-quarantine-with-a-new-xattr/ + makeFlags = lib.optionals stdenv.buildPlatform.isDarwin [ "XATTR=/does-not-exist" ]; + # Patch scripts to include runtime dependencies in $PATH. postInstall = '' for i in "$out/bin/"*; do diff --git a/pkgs/development/compilers/ghc/9.6.3-binary.nix b/pkgs/development/compilers/ghc/9.6.3-binary.nix index 73cdc3019418..ff6a6dba5478 100644 --- a/pkgs/development/compilers/ghc/9.6.3-binary.nix +++ b/pkgs/development/compilers/ghc/9.6.3-binary.nix @@ -326,6 +326,15 @@ stdenv.mkDerivation { # calls install-strip ... dontBuild = true; + # GHC tries to remove xattrs when installing to work around Gatekeeper + # (see https://gitlab.haskell.org/ghc/ghc/-/issues/17418). This step normally + # succeeds in nixpkgs because xattrs are not allowed in the store, but it + # can fail when a file has the `com.apple.provenance` xattr, and it can’t be + # modified (such as target of the symlink to `libiconv.dylib`). + # The `com.apple.provenance` xattr is a new feature of macOS as of macOS 13. + # See: https://eclecticlight.co/2023/03/13/ventura-has-changed-app-quarantine-with-a-new-xattr/ + makeFlags = lib.optionals stdenv.buildPlatform.isDarwin [ "XATTR=/does-not-exist" ]; + # Patch scripts to include runtime dependencies in $PATH. postInstall = '' diff --git a/pkgs/development/compilers/ghc/common-make-native-bignum.nix b/pkgs/development/compilers/ghc/common-make-native-bignum.nix index 03ad68c392a1..65c5e39bfada 100644 --- a/pkgs/development/compilers/ghc/common-make-native-bignum.nix +++ b/pkgs/development/compilers/ghc/common-make-native-bignum.nix @@ -364,6 +364,18 @@ stdenv.mkDerivation ( else ./Cabal-3.2-3.4-paths-fix-cycle-aarch64-darwin.patch ) + ] + # Fixes stack overrun in rts which crashes an process whenever + # freeHaskellFunPtr is called with nixpkgs' hardening flags. + # https://gitlab.haskell.org/ghc/ghc/-/issues/25485 + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13599 + # TODO: patch doesn't apply for < 9.4, but may still be necessary? + ++ lib.optionals (lib.versionAtLeast version "9.4") [ + (fetchpatch { + name = "ghc-rts-adjustor-fix-i386-stack-overrun.patch"; + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/39bb6e583d64738db51441a556d499aa93a4fc4a.patch"; + sha256 = "0w5fx413z924bi2irsy1l4xapxxhrq158b5gn6jzrbsmhvmpirs0"; + }) ]; postPatch = "patchShebangs ."; @@ -593,6 +605,13 @@ stdenv.mkDerivation ( # Hydra which already warrants a significant speedup requiredSystemFeatures = [ "big-parallel" ]; + # Install occasionally fails due to a race condition in minimal builds. + # > /nix/store/wyzpysxwgs3qpvmylm9krmfzh2plicix-coreutils-9.7/bin/install -c -m 755 -d "/nix/store/xzb3390rhvhg2a0cvzmrvjspw1d8nf8h-ghc-riscv64-unknown-linux-gnu-9.4.8/bin" + # > install: cannot create regular file '/nix/store/xzb3390rhvhg2a0cvzmrvjspw1d8nf8h-ghc-riscv64-unknown-linux-gnu-9.4.8/lib/ghc-9.4.8': No such file or directory + preInstall = '' + mkdir -p "$out/lib/${passthru.haskellCompilerName}" + ''; + postInstall = '' settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings" diff --git a/pkgs/development/compilers/go/1.24.nix b/pkgs/development/compilers/go/1.24.nix index ac8828d873a4..fbccce4cd017 100644 --- a/pkgs/development/compilers/go/1.24.nix +++ b/pkgs/development/compilers/go/1.24.nix @@ -27,11 +27,11 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "go"; - version = "1.24.3"; + version = "1.24.4"; src = fetchurl { url = "https://go.dev/dl/go${finalAttrs.version}.src.tar.gz"; - hash = "sha256-IpwItgCxRGeYEJ+uH1aSKBAshHPKuoEEtkGMtbwDKHg="; + hash = "sha256-WoaoOjH5+oFJC4xUIKw4T9PZWj5x+6Zlx7P5XR3+8rQ="; }; strictDeps = true; diff --git a/pkgs/development/compilers/llvm/common/clang/default.nix b/pkgs/development/compilers/llvm/common/clang/default.nix index a34746b8e079..d121bfcd7869 100644 --- a/pkgs/development/compilers/llvm/common/clang/default.nix +++ b/pkgs/development/compilers/llvm/common/clang/default.nix @@ -201,6 +201,8 @@ stdenv.mkDerivation ( "python" ]; + separateDebugInfo = true; + postInstall = '' ln -sv $out/bin/clang $out/bin/cpp diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index 6051243f6668..42af5fa8be2b 100644 --- a/pkgs/development/compilers/llvm/common/llvm/default.nix +++ b/pkgs/development/compilers/llvm/common/llvm/default.nix @@ -526,6 +526,8 @@ stdenv.mkDerivation ( optionalString stdenv.hostPlatform.isFreeBSD '' rm test/tools/llvm-libtool-darwin/L-and-l.test rm test/ExecutionEngine/Interpreter/intrinsics.ll + # Fails in sandbox + substituteInPlace unittests/Support/LockFileManagerTest.cpp --replace-fail "Basic" "DISABLED_Basic" '' + '' patchShebangs test/BugPoint/compile-custom.ll.py diff --git a/pkgs/development/compilers/llvm/common/tblgen.nix b/pkgs/development/compilers/llvm/common/tblgen.nix index 2c2d541d36a9..f6445df64747 100644 --- a/pkgs/development/compilers/llvm/common/tblgen.nix +++ b/pkgs/development/compilers/llvm/common/tblgen.nix @@ -7,6 +7,7 @@ ninja, patches ? [ ], python3, + updateAutotoolsGnuConfigScriptsHook, release_version, runCommand, src ? null, @@ -76,6 +77,10 @@ let cmake ninja python3 + + # while this is not an autotools build, it still includes a config.guess + # this is needed until scripts are updated to not use /usr/bin/uname on FreeBSD native + updateAutotoolsGnuConfigScriptsHook ]; cmakeFlags = [ diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 3d25e24e2dcf..6c135c3f2595 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -21,10 +21,10 @@ sourceVersion = { major = "3"; minor = "13"; - patch = "3"; + patch = "4"; suffix = ""; }; - hash = "sha256-QPhovL3rgUmjFJWAu5v9QHszIc1I8L5jGvlVrJLA4EE="; + hash = "sha256-J7FaeXViopcdzj/+MbshYELOC5lbOddozxX3hMx1c2U="; }; }; @@ -48,10 +48,10 @@ sourceVersion = { major = "3"; minor = "10"; - patch = "17"; + patch = "18"; suffix = ""; }; - hash = "sha256-TGgFDwSdG0rFqt0N9fJ5QcA1DSqeerCQfuXrUiXZ1rA="; + hash = "sha256-rmZbxnir2atqbhVz0kgWJaU3GbxRfppjTtK5/vrjgX8="; inherit passthruFun; }; @@ -60,10 +60,10 @@ sourceVersion = { major = "3"; minor = "11"; - patch = "12"; + patch = "13"; suffix = ""; }; - hash = "sha256-hJ2oevTfE3cQwXluJ2qVX3qFyflxCBBnyPVl0Vw1Kgk="; + hash = "sha256-j7X5+8dgn6giyzFUmIRXXbf9llfL/7iVELXXl1ljqDo="; inherit passthruFun; }; @@ -72,10 +72,10 @@ sourceVersion = { major = "3"; minor = "12"; - patch = "10"; + patch = "11"; suffix = ""; }; - hash = "sha256-B6tpdHRZXgbwZkdBfTx/qX3tB6/Bp+RFTFY5kZtG6uo="; + hash = "sha256-wwuyS38emhmxG1WlRkNPdOc5u0wnGj46gP9DgNSfets="; inherit passthruFun; }; diff --git a/pkgs/development/libraries/avahi/default.nix b/pkgs/development/libraries/avahi/default.nix index fb9437819e1b..312ef4bb39c7 100644 --- a/pkgs/development/libraries/avahi/default.nix +++ b/pkgs/development/libraries/avahi/default.nix @@ -134,6 +134,12 @@ stdenv.mkDerivation rec { url = "https://github.com/avahi/avahi/commit/f8710bdc8b29ee1176fe3bfaeabebbda1b7a79f7.patch"; hash = "sha256-BUQOQ4evKLBzV5UV8xW8XL38qk1rg6MJ/vcT5NBckfA="; }) + # https://github.com/avahi/avahi/pull/265 merged Mar 3, 2020 + (fetchpatch { + name = "fix-requires-in-pc-file.patch"; + url = "https://github.com/avahi/avahi/commit/366e3798bdbd6b7bf24e59379f4a9a51af575ce9.patch"; + hash = "sha256-9AdhtzrimmcpMmeyiFcjmDfG5nqr/S8cxWTaM1mzCWA="; + }) ]; depsBuildBuild = [ diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index 59654edc479e..4d132edb76a3 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -10,12 +10,14 @@ gperf, dejavu_fonts, autoreconfHook, + versionCheckHook, testers, + gitUpdater, }: stdenv.mkDerivation (finalAttrs: { pname = "fontconfig"; - version = "2.16.0"; + version = "2.16.2"; outputs = [ "bin" @@ -24,11 +26,11 @@ stdenv.mkDerivation (finalAttrs: { "out" ]; # $out contains all the config + # GitLab repositrory does not include pre-generated man pages. + # ref: https://github.com/NixOS/nixpkgs/pull/401037#discussion_r2055430206 src = fetchurl { - url = - with finalAttrs; - "https://www.freedesktop.org/software/fontconfig/release/${pname}-${version}.tar.xz"; - hash = "sha256-ajPcVVzJuosQyvdpWHjvE07rNtCvNmBB9jmx2ptu0iA="; + url = "https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/${finalAttrs.version}/fontconfig-${finalAttrs.version}.tar.xz"; + hash = "sha256-FluP0qEZhkyHRksjOYbEobwJ77CcZd4cpAzB6F/7d+I="; }; nativeBuildInputs = [ @@ -91,9 +93,32 @@ stdenv.mkDerivation (finalAttrs: { rm -r $bin/share/man/man3 ''; - passthru.tests = { - pkg-config = testers.hasPkgConfigModules { - package = finalAttrs.finalPackage; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + versionCheckProgram = "${placeholder "bin"}/bin/fc-list"; + versionCheckProgramArg = "--version"; + + installCheckPhase = '' + runHook preInstallCheck + + [ -d "$bin/share/man/man1" ] + [ -d "$bin/share/man/man5" ] + echo "man pages exist" + + runHook postInstallCheck + ''; + + passthru = { + tests = { + pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + }; + }; + + updateScript = gitUpdater { + url = "https://gitlab.freedesktop.org/fontconfig/fontconfig.git"; }; }; diff --git a/pkgs/development/libraries/libunwind/default.nix b/pkgs/development/libraries/libunwind/default.nix index f0f7de192f44..b6b8ab73142f 100644 --- a/pkgs/development/libraries/libunwind/default.nix +++ b/pkgs/development/libraries/libunwind/default.nix @@ -11,13 +11,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "libunwind"; - version = "1.8.1"; + version = "1.8.2"; src = fetchFromGitHub { owner = "libunwind"; repo = "libunwind"; rev = "v${finalAttrs.version}"; - hash = "sha256-rCFBHs6rCSnp5FEwbUR5veNNTqSQpFblAv8ebSPX0qE="; + hash = "sha256-MsUReXFHlj15SgEZHOYhdSfAbSeVVl8LCi4NnUwvhpw="; }; patches = lib.optional (stdenv.targetPlatform.useLLVM or false) (fetchpatch { @@ -60,6 +60,8 @@ stdenv.mkDerivation (finalAttrs: { propagatedBuildInputs = [ xz ]; + enableParallelBuilding = true; + postInstall = '' find $out -name \*.la | while read file; do sed -i 's,-llzma,${xz.out}/lib/liblzma.la,' $file diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index 871a2cf93bd1..4722376372e5 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -88,7 +88,10 @@ stdenv.mkDerivation rec { "-DSQLITE_ENABLE_FTS3_TOKENIZER" "-DSQLITE_ENABLE_FTS4" "-DSQLITE_ENABLE_FTS5" + "-DSQLITE_ENABLE_GEOPOLY" + "-DSQLITE_ENABLE_MATH_FUNCTIONS" "-DSQLITE_ENABLE_PREUPDATE_HOOK" + "-DSQLITE_ENABLE_RBU" "-DSQLITE_ENABLE_RTREE" "-DSQLITE_ENABLE_SESSION" "-DSQLITE_ENABLE_STMT_SCANSTATUS" diff --git a/pkgs/development/python-modules/ahocorasick-rs/default.nix b/pkgs/development/python-modules/ahocorasick-rs/default.nix index 239ea2f453b9..047ef8e91d00 100644 --- a/pkgs/development/python-modules/ahocorasick-rs/default.nix +++ b/pkgs/development/python-modules/ahocorasick-rs/default.nix @@ -42,6 +42,8 @@ buildPythonPackage rec { hypothesis ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + pythonImportsCheck = [ "ahocorasick_rs" ]; meta = with lib; { diff --git a/pkgs/development/python-modules/automat/default.nix b/pkgs/development/python-modules/automat/default.nix index 7833eb27f57c..094824ae06e9 100644 --- a/pkgs/development/python-modules/automat/default.nix +++ b/pkgs/development/python-modules/automat/default.nix @@ -32,6 +32,8 @@ let pytestCheckHook ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + # escape infinite recursion with twisted doCheck = false; diff --git a/pkgs/development/python-modules/aws-secretsmanager-caching/default.nix b/pkgs/development/python-modules/aws-secretsmanager-caching/default.nix index daf6adf4f00c..f8df8da92d19 100644 --- a/pkgs/development/python-modules/aws-secretsmanager-caching/default.nix +++ b/pkgs/development/python-modules/aws-secretsmanager-caching/default.nix @@ -3,6 +3,7 @@ botocore, buildPythonPackage, fetchPypi, + pytest-cov-stub, pytestCheckHook, pythonAtLeast, pythonOlder, @@ -23,11 +24,6 @@ buildPythonPackage rec { hash = "sha256-9tbsnUPg2+T21d6982tMtpHRWpZ7NYsldfXZGXSmwP8="; }; - patches = [ - # Remove coverage tests from the pytest invocation in setup.cfg. - ./remove-coverage-tests.patch - ]; - postPatch = '' substituteInPlace setup.py \ --replace-fail "'pytest-runner'," "" @@ -40,7 +36,10 @@ buildPythonPackage rec { setuptools # Needs pkg_resources at runtime. ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytest-cov-stub + pytestCheckHook + ]; disabledTestPaths = [ # Integration tests require networking. diff --git a/pkgs/development/python-modules/aws-secretsmanager-caching/remove-coverage-tests.patch b/pkgs/development/python-modules/aws-secretsmanager-caching/remove-coverage-tests.patch deleted file mode 100644 index 57af75dcb4fa..000000000000 --- a/pkgs/development/python-modules/aws-secretsmanager-caching/remove-coverage-tests.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/setup.cfg b/setup.cfg -index 5aa81b2..0c02ded 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -3,9 +3,6 @@ xfail_strict = true - addopts = - --verbose - --doctest-modules -- --cov aws_secretsmanager_caching -- --cov-fail-under 90 -- --cov-report term-missing - --ignore doc/ - - [aliases] diff --git a/pkgs/development/python-modules/boost-histogram/default.nix b/pkgs/development/python-modules/boost-histogram/default.nix index c0f7c257da9d..610674ea032a 100644 --- a/pkgs/development/python-modules/boost-histogram/default.nix +++ b/pkgs/development/python-modules/boost-histogram/default.nix @@ -58,6 +58,8 @@ buildPythonPackage rec { pytest-benchmark ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + disabledTests = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ # Segfaults: boost_histogram/_internal/hist.py", line 799 in sum # Fatal Python error: Segmentation fault diff --git a/pkgs/development/python-modules/cairosvg/default.nix b/pkgs/development/python-modules/cairosvg/default.nix index 0d81670d4493..e3971469736f 100644 --- a/pkgs/development/python-modules/cairosvg/default.nix +++ b/pkgs/development/python-modules/cairosvg/default.nix @@ -1,30 +1,37 @@ { lib, buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies cairocffi, cssselect2, defusedxml, - fetchPypi, pillow, - pytestCheckHook, - setuptools, tinycss2, + + # testing + pytestCheckHook, }: buildPythonPackage rec { pname = "cairosvg"; - version = "2.7.1"; + version = "2.8.2"; pyproject = true; - src = fetchPypi { - pname = "CairoSVG"; - inherit version; - hash = "sha256-QyUx1yNHKRuanr+2d3AmtgdWP9hxnEbudC2wrvcnG6A="; + src = fetchFromGitHub { + owner = "Kozea"; + repo = "CairoSVG"; + tag = version; + hash = "sha256-KWUZA8pcHMnDEkAYZt3zDzPNynhGBuLZuagNPfHF8EA="; }; - nativeBuildInputs = [ setuptools ]; + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ cairocffi cssselect2 defusedxml @@ -32,20 +39,10 @@ buildPythonPackage rec { tinycss2 ]; - propagatedNativeBuildInputs = [ cairocffi ]; + nativeBuildInputs = [ cairocffi ]; nativeCheckInputs = [ pytestCheckHook ]; - postPatch = '' - substituteInPlace setup.cfg \ - --replace "pytest-runner" "" \ - --replace "pytest-flake8" "" \ - --replace "pytest-isort" "" \ - --replace "pytest-cov" "" \ - --replace "--flake8" "" \ - --replace "--isort" "" - ''; - pytestFlagsArray = [ "cairosvg/test_api.py" ]; pythonImportsCheck = [ "cairosvg" ]; diff --git a/pkgs/development/python-modules/clldutils/default.nix b/pkgs/development/python-modules/clldutils/default.nix index 71f270396258..70800b121f5b 100644 --- a/pkgs/development/python-modules/clldutils/default.nix +++ b/pkgs/development/python-modules/clldutils/default.nix @@ -11,6 +11,7 @@ mock, postgresql, pylatexenc, + pytest-cov-stub, pytest-mock, pytestCheckHook, python-dateutil, @@ -32,11 +33,6 @@ buildPythonPackage rec { hash = "sha256-OD+WJ9JuYZb/oXDgVqL4i5YlcVEt0+swq0SB3cutyRo="; }; - patchPhase = '' - substituteInPlace setup.cfg \ - --replace-fail "--cov" "" - ''; - nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ @@ -53,6 +49,7 @@ buildPythonPackage rec { nativeCheckInputs = [ mock postgresql + pytest-cov-stub pytest-mock pytestCheckHook git diff --git a/pkgs/development/python-modules/colorzero/default.nix b/pkgs/development/python-modules/colorzero/default.nix index 09a40420e1b6..589013649fc9 100644 --- a/pkgs/development/python-modules/colorzero/default.nix +++ b/pkgs/development/python-modules/colorzero/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, pkginfo, pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -18,16 +19,14 @@ buildPythonPackage rec { hash = "sha256-0NoQsy86OHQNLZsTEuF5s2MlRUoacF28jNeHgFKAH14="; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace "--cov" "" - ''; - nativeBuildInputs = [ pkginfo ]; pythonImportsCheck = [ "colorzero" ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; meta = with lib; { description = "Yet another Python color library"; diff --git a/pkgs/development/python-modules/configupdater/default.nix b/pkgs/development/python-modules/configupdater/default.nix index 9e052140d48f..4abf86805d36 100644 --- a/pkgs/development/python-modules/configupdater/default.nix +++ b/pkgs/development/python-modules/configupdater/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchPypi, pytestCheckHook, + pytest-cov-stub, setuptools-scm, }: @@ -17,16 +18,14 @@ buildPythonPackage rec { hash = "sha256-n9rFODHBsGKSm/OYtkm4fKMOfxpzXz+/SCBygEEGMGs="; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace '--cov configupdater --cov-report term-missing' "" - ''; - nativeBuildInputs = [ setuptools-scm ]; pythonImportsCheck = [ "configupdater" ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; meta = with lib; { description = "Parser like ConfigParser but for updating configuration files"; diff --git a/pkgs/development/python-modules/convertertools/default.nix b/pkgs/development/python-modules/convertertools/default.nix index 5d51a59946a6..2114a6955ed2 100644 --- a/pkgs/development/python-modules/convertertools/default.nix +++ b/pkgs/development/python-modules/convertertools/default.nix @@ -11,6 +11,7 @@ # checks pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -27,17 +28,16 @@ buildPythonPackage rec { hash = "sha256-Oy1Nf/mS2Lr2N7OB27QDlW+uuhafib2kolEXzXLppWU="; }; - postPatch = '' - sed -i "/--cov/d" pyproject.toml - ''; - build-system = [ cython poetry-core setuptools ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "convertertools" ]; diff --git a/pkgs/development/python-modules/csvw/default.nix b/pkgs/development/python-modules/csvw/default.nix index be429844d13d..a85c9d4f0fd4 100644 --- a/pkgs/development/python-modules/csvw/default.nix +++ b/pkgs/development/python-modules/csvw/default.nix @@ -10,6 +10,7 @@ rfc3986, uritemplate, pytestCheckHook, + pytest-cov-stub, pytest-mock, }: @@ -37,14 +38,10 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub pytest-mock ]; - patchPhase = '' - substituteInPlace setup.cfg \ - --replace "--cov" "" - ''; - disabledTests = [ # this test is flaky on darwin because it depends on the resolution of filesystem mtimes diff --git a/pkgs/development/python-modules/dbus-next/default.nix b/pkgs/development/python-modules/dbus-next/default.nix index b73691b3ca24..ea9add04940d 100644 --- a/pkgs/development/python-modules/dbus-next/default.nix +++ b/pkgs/development/python-modules/dbus-next/default.nix @@ -6,7 +6,6 @@ setuptools, dbus, pytest, - pytest-cov-stub, pytest-asyncio, pytest-timeout, }: @@ -28,7 +27,6 @@ buildPythonPackage rec { nativeCheckInputs = [ dbus pytest - pytest-cov-stub pytest-asyncio pytest-timeout ]; @@ -42,7 +40,7 @@ buildPythonPackage rec { checkPhase = '' runHook preCheck dbus-run-session --config-file=${dbus}/share/dbus-1/session.conf \ - ${python.interpreter} -m pytest -sv --cov=dbus_next \ + ${python.interpreter} -m pytest -sv \ -k "not test_peer_interface and not test_tcp_connection_with_forwarding" runHook postCheck ''; diff --git a/pkgs/development/python-modules/deltalake/default.nix b/pkgs/development/python-modules/deltalake/default.nix index 58fa044f6b7d..5318e09a17ac 100644 --- a/pkgs/development/python-modules/deltalake/default.nix +++ b/pkgs/development/python-modules/deltalake/default.nix @@ -78,7 +78,10 @@ buildPythonPackage rec { rm -rf deltalake ''; - pytestFlagsArray = [ "-m 'not integration'" ]; + pytestFlagsArray = [ + "--benchmark-disable" + "-m 'not integration'" + ]; meta = with lib; { description = "Native Rust library for Delta Lake, with bindings into Python"; diff --git a/pkgs/development/python-modules/demes/default.nix b/pkgs/development/python-modules/demes/default.nix index 658acdb8156f..a3f73c6821b1 100644 --- a/pkgs/development/python-modules/demes/default.nix +++ b/pkgs/development/python-modules/demes/default.nix @@ -7,6 +7,7 @@ attrs, pythonOlder, pytest7CheckHook, + pytest-cov-stub, pytest-xdist, numpy, }: @@ -29,13 +30,9 @@ buildPythonPackage rec { attrs ]; - postPatch = '' - # remove coverage arguments to pytest - sed -i '/--cov/d' setup.cfg - ''; - nativeCheckInputs = [ pytest7CheckHook + pytest-cov-stub pytest-xdist numpy ]; diff --git a/pkgs/development/python-modules/demesdraw/default.nix b/pkgs/development/python-modules/demesdraw/default.nix index 6a3c4d44e99a..35a51048d81d 100644 --- a/pkgs/development/python-modules/demesdraw/default.nix +++ b/pkgs/development/python-modules/demesdraw/default.nix @@ -10,6 +10,7 @@ scipy, pythonOlder, pytestCheckHook, + pytest-cov-stub, pytest-xdist, mpmath, }: @@ -34,17 +35,13 @@ buildPythonPackage rec { scipy ]; - postPatch = '' - # remove coverage arguments to pytest - sed -i '/--cov/d' setup.cfg - ''; - # This variable is needed to suppress the "Trace/BPT trap: 5" error in Darwin's checkPhase. # Not sure of the details, but we can avoid it by changing the matplotlib backend during testing. env.MPLBACKEND = lib.optionalString stdenv.hostPlatform.isDarwin "Agg"; nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub pytest-xdist mpmath ]; diff --git a/pkgs/development/python-modules/discovery30303/default.nix b/pkgs/development/python-modules/discovery30303/default.nix index 1b877818e397..bf498e5dcc20 100644 --- a/pkgs/development/python-modules/discovery30303/default.nix +++ b/pkgs/development/python-modules/discovery30303/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, poetry-core, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, }: @@ -22,15 +23,11 @@ buildPythonPackage rec { hash = "sha256-QIGLRe+nUV3tUOs+pu6Qk/2Amh9IVcQq89o2JeKiTvM="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail " --cov=discovery30303" "" - ''; - nativeBuildInputs = [ poetry-core ]; nativeCheckInputs = [ pytest-asyncio + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/diskcache/default.nix b/pkgs/development/python-modules/diskcache/default.nix index 8211267f2eb0..302eb675c39d 100644 --- a/pkgs/development/python-modules/diskcache/default.nix +++ b/pkgs/development/python-modules/diskcache/default.nix @@ -3,6 +3,7 @@ stdenv, buildPythonPackage, fetchFromGitHub, + pytest-cov-stub, pytest-django, pytest-xdist, pytestCheckHook, @@ -24,15 +25,12 @@ buildPythonPackage rec { }; nativeCheckInputs = [ + pytest-cov-stub pytest-django pytest-xdist pytestCheckHook ]; - postPatch = '' - sed -i "/--cov/d" tox.ini - ''; - # Darwin sandbox causes most tests to fail doCheck = !stdenv.hostPlatform.isDarwin; diff --git a/pkgs/development/python-modules/django-markup/default.nix b/pkgs/development/python-modules/django-markup/default.nix index e3b697a659c4..f5d5eeaaa93c 100644 --- a/pkgs/development/python-modules/django-markup/default.nix +++ b/pkgs/development/python-modules/django-markup/default.nix @@ -20,6 +20,7 @@ textile, # tests + pytest-cov-stub, pytest-django, pytestCheckHook, }: @@ -38,10 +39,6 @@ buildPythonPackage rec { hash = "sha256-dj5Z36W4Stly203SKWpR/DF+Wf7+ejbZnDCmHNRb3c0="; }; - postPatch = '' - sed -i "/--cov/d" pyproject.toml - ''; - build-system = [ poetry-core ]; dependencies = [ django ]; @@ -61,6 +58,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "django_markup" ]; nativeCheckInputs = [ + pytest-cov-stub pytest-django pytestCheckHook ] ++ optional-dependencies.all_filter_dependencies; diff --git a/pkgs/development/python-modules/django/4.nix b/pkgs/development/python-modules/django/4.nix index d3fe21dfcd5c..9630b88e51c8 100644 --- a/pkgs/development/python-modules/django/4.nix +++ b/pkgs/development/python-modules/django/4.nix @@ -45,7 +45,7 @@ buildPythonPackage rec { pname = "django"; - version = "4.2.21"; + version = "4.2.22"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -54,7 +54,7 @@ buildPythonPackage rec { owner = "django"; repo = "django"; rev = "refs/tags/${version}"; - hash = "sha256-GiOPIuYJAkMPW8JccJvFEoQi36rCmySHeLB7mAmg6CM="; + hash = "sha256-+kq3GF2Q8uaa+UsZK5uWQIyW9tSjfKAE+yiuDTSVwwA="; }; patches = diff --git a/pkgs/development/python-modules/dramatiq/default.nix b/pkgs/development/python-modules/dramatiq/default.nix index 60055e50e3eb..5a53457793c6 100644 --- a/pkgs/development/python-modules/dramatiq/default.nix +++ b/pkgs/development/python-modules/dramatiq/default.nix @@ -9,6 +9,7 @@ prometheus-client, pylibmc, pytestCheckHook, + pytest-cov-stub, redis, setuptools, watchdog, @@ -54,6 +55,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub pika redis pylibmc @@ -61,8 +63,6 @@ buildPythonPackage rec { postPatch = '' sed -i ./setup.cfg \ - -e 's:--cov dramatiq::' \ - -e 's:--cov-report html::' \ -e 's:--benchmark-autosave::' \ -e 's:--benchmark-compare::' \ ''; diff --git a/pkgs/development/python-modules/duecredit/default.nix b/pkgs/development/python-modules/duecredit/default.nix index 5aa4505b9196..05977754a127 100644 --- a/pkgs/development/python-modules/duecredit/default.nix +++ b/pkgs/development/python-modules/duecredit/default.nix @@ -5,6 +5,7 @@ pythonOlder, setuptools, pytestCheckHook, + pytest-cov-stub, vcrpy, citeproc-py, looseversion, @@ -23,12 +24,6 @@ buildPythonPackage rec { hash = "sha256-/nOiDk+7LZcroB7fN97BsLoeZG7+XvTMrwxnJMoofUI="; }; - postPatch = '' - substituteInPlace tox.ini \ - --replace-fail "--cov=duecredit" "" \ - --replace-fail "--cov-config=tox.ini" "" - ''; - nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ citeproc-py @@ -38,6 +33,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub vcrpy ]; disabledTests = [ "test_import_doi" ]; # tries to access network diff --git a/pkgs/development/python-modules/energyzero/default.nix b/pkgs/development/python-modules/energyzero/default.nix index 9bf8f24b4da3..a3896ec4c5c9 100644 --- a/pkgs/development/python-modules/energyzero/default.nix +++ b/pkgs/development/python-modules/energyzero/default.nix @@ -6,6 +6,7 @@ fetchFromGitHub, poetry-core, pytest-asyncio, + pytest-cov-stub, pytest-freezer, pytestCheckHook, pythonOlder, @@ -29,8 +30,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace-fail '"0.0.0"' '"${version}"' \ - --replace-fail 'addopts = "--cov"' "" + --replace-fail '"0.0.0"' '"${version}"' ''; build-system = [ poetry-core ]; @@ -43,6 +43,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aresponses pytest-asyncio + pytest-cov-stub pytest-freezer pytestCheckHook syrupy diff --git a/pkgs/development/python-modules/fastcrc/default.nix b/pkgs/development/python-modules/fastcrc/default.nix index 1a87ccbec7c9..08f3ecacb279 100644 --- a/pkgs/development/python-modules/fastcrc/default.nix +++ b/pkgs/development/python-modules/fastcrc/default.nix @@ -42,6 +42,8 @@ buildPythonPackage { pytest-benchmark ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + # Python source files interfere with testing preCheck = '' rm -r fastcrc diff --git a/pkgs/development/python-modules/flask-dramatiq/default.nix b/pkgs/development/python-modules/flask-dramatiq/default.nix index df943b1d8ed1..4aa30f39808a 100644 --- a/pkgs/development/python-modules/flask-dramatiq/default.nix +++ b/pkgs/development/python-modules/flask-dramatiq/default.nix @@ -8,6 +8,7 @@ flask, requests, pytestCheckHook, + pytest-cov-stub, flask-migrate, periodiq, postgresql, @@ -35,10 +36,6 @@ buildPythonPackage { --replace 'poetry.masonry.api' 'poetry.core.masonry.api' patchShebangs --build ./example.py - - sed -i ./tests/unit/pytest.ini \ - -e 's:--cov=flask_dramatiq::' \ - -e 's:--cov-report=term-missing::' ''; nativeBuildInputs = [ poetry-core ]; @@ -47,6 +44,7 @@ buildPythonPackage { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub flask requests flask-migrate diff --git a/pkgs/development/python-modules/flit-gettext/default.nix b/pkgs/development/python-modules/flit-gettext/default.nix index cdf3dadf14ed..48d073c59bfc 100644 --- a/pkgs/development/python-modules/flit-gettext/default.nix +++ b/pkgs/development/python-modules/flit-gettext/default.nix @@ -15,6 +15,7 @@ # tests build, pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -35,10 +36,6 @@ buildPythonPackage rec { }) ]; - postPatch = '' - sed -i "s/--cov//" pyproject.toml - ''; - nativeBuildInputs = [ flit-scm wheel @@ -53,6 +50,7 @@ buildPythonPackage rec { nativeCheckInputs = [ build pytestCheckHook + pytest-cov-stub wheel ] ++ optional-dependencies.scm; diff --git a/pkgs/development/python-modules/flufl/i18n.nix b/pkgs/development/python-modules/flufl/i18n.nix index 3a7295e0a087..acfa292cc821 100644 --- a/pkgs/development/python-modules/flufl/i18n.nix +++ b/pkgs/development/python-modules/flufl/i18n.nix @@ -6,6 +6,7 @@ atpublic, pdm-pep517, pytestCheckHook, + pytest-cov-stub, sybil, }: @@ -22,11 +23,6 @@ buildPythonPackage rec { hash = "sha256-wKz6aggkJ9YBJ+o75XjC4Ddnn+Zi9hlYDnliwTc7DNs="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--cov=flufl --cov-report=term --cov-report=xml" "" - ''; - nativeBuildInputs = [ pdm-pep517 ]; propagatedBuildInputs = [ atpublic ]; @@ -35,6 +31,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub sybil ]; diff --git a/pkgs/development/python-modules/fpdf2/default.nix b/pkgs/development/python-modules/fpdf2/default.nix index f7b0f221e962..55a223cc859a 100644 --- a/pkgs/development/python-modules/fpdf2/default.nix +++ b/pkgs/development/python-modules/fpdf2/default.nix @@ -10,6 +10,7 @@ fonttools, pytestCheckHook, + pytest-cov-stub, qrcode, camelot, uharfbuzz, @@ -28,11 +29,6 @@ buildPythonPackage rec { hash = "sha256-NfHMmyFT+ZpqfRc41DetbFXs/twr12XagOkk3nGhrYk="; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace-fail "--cov=fpdf --cov-report=xml" "" - ''; - nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ @@ -43,6 +39,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub qrcode camelot uharfbuzz diff --git a/pkgs/development/python-modules/freenub/default.nix b/pkgs/development/python-modules/freenub/default.nix index 6c3702f6bbf2..c06a6c80830e 100644 --- a/pkgs/development/python-modules/freenub/default.nix +++ b/pkgs/development/python-modules/freenub/default.nix @@ -8,6 +8,7 @@ pycryptodomex, busypie, pytest-asyncio, + pytest-cov-stub, pytest-vcr, pytestCheckHook, requests, @@ -28,10 +29,6 @@ buildPythonPackage rec { hash = "sha256-UkW/7KUQ4uCu3cxDSL+kw0gjKjs4KnmxRIOLVP4hwyA="; }; - postPatch = '' - sed -i "/--cov/d" pyproject.toml - ''; - build-system = [ poetry-core ]; dependencies = [ @@ -44,6 +41,7 @@ buildPythonPackage rec { nativeCheckInputs = [ busypie pytest-asyncio + pytest-cov-stub pytest-vcr pytestCheckHook ]; diff --git a/pkgs/development/python-modules/gilknocker/default.nix b/pkgs/development/python-modules/gilknocker/default.nix index e3a9438d8cab..06e0376e50d7 100644 --- a/pkgs/development/python-modules/gilknocker/default.nix +++ b/pkgs/development/python-modules/gilknocker/default.nix @@ -54,6 +54,8 @@ buildPythonPackage rec { pytest-rerunfailures ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + meta = { description = "Knock on the Python GIL, determine how busy it is"; homepage = "https://github.com/milesgranger/gilknocker"; diff --git a/pkgs/development/python-modules/git-url-parse/default.nix b/pkgs/development/python-modules/git-url-parse/default.nix index 67a0e5a38030..5327a2cbbbe1 100644 --- a/pkgs/development/python-modules/git-url-parse/default.nix +++ b/pkgs/development/python-modules/git-url-parse/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, pbr, pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -18,11 +19,6 @@ buildPythonPackage rec { hash = "sha256-+0V/C3wE02ppdDGn7iqdvmgsUwTR7THUakUilvkzoYg="; }; - postPatch = '' - substituteInPlace pytest.ini \ - --replace " --cov giturlparse --cov-report term-missing" "" - ''; - # Manually set version because prb wants to get it from the git # upstream repository (and we are installing from tarball instead) env.PBR_VERSION = version; @@ -31,7 +27,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "giturlparse" ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; meta = with lib; { description = "Simple GIT URL parser"; diff --git a/pkgs/development/python-modules/gpiozero/default.nix b/pkgs/development/python-modules/gpiozero/default.nix index 30fb18a81f1d..516de75e2d74 100644 --- a/pkgs/development/python-modules/gpiozero/default.nix +++ b/pkgs/development/python-modules/gpiozero/default.nix @@ -16,6 +16,7 @@ # tests pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -32,11 +33,6 @@ buildPythonPackage rec { hash = "sha256-ifdCFcMH6SrhKQK/TJJ5lJafSfAUzd6ZT5ANUzJGwxI="; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace " --cov" "" - ''; - outputs = [ "out" "doc" @@ -50,7 +46,10 @@ buildPythonPackage rec { propagatedBuildInputs = [ colorzero ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "gpiozero" diff --git a/pkgs/development/python-modules/graphql-core/default.nix b/pkgs/development/python-modules/graphql-core/default.nix index 419c62ea4cf4..1d1966183540 100644 --- a/pkgs/development/python-modules/graphql-core/default.nix +++ b/pkgs/development/python-modules/graphql-core/default.nix @@ -39,6 +39,8 @@ buildPythonPackage rec { pytestCheckHook ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + pythonImportsCheck = [ "graphql" ]; meta = with lib; { diff --git a/pkgs/development/python-modules/gridnet/default.nix b/pkgs/development/python-modules/gridnet/default.nix index 6763a42291a6..6b89ae50b019 100644 --- a/pkgs/development/python-modules/gridnet/default.nix +++ b/pkgs/development/python-modules/gridnet/default.nix @@ -6,6 +6,7 @@ fetchFromGitHub, poetry-core, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, yarl, @@ -27,8 +28,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace "0.0.0" "${version}" \ - --replace "--cov" "" + --replace "0.0.0" "${version}" ''; nativeBuildInputs = [ poetry-core ]; @@ -41,6 +41,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aresponses pytest-asyncio + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/h5io/default.nix b/pkgs/development/python-modules/h5io/default.nix index 8b17e173d80e..0d5f24dd1382 100644 --- a/pkgs/development/python-modules/h5io/default.nix +++ b/pkgs/development/python-modules/h5io/default.nix @@ -12,6 +12,7 @@ # tests pytestCheckHook, + pytest-cov-stub, scipy, tables, }: @@ -28,13 +29,6 @@ buildPythonPackage rec { hash = "sha256-ZkG9e7KtDvoRq9XCExYseE+Z7tMQTWcSiwsSrN5prdI="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--cov-report=" "" \ - --replace "--cov-branch" "" \ - --replace "--cov=h5io" "" - ''; - build-system = [ setuptools-scm ]; dependencies = [ @@ -44,6 +38,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub scipy tables ]; diff --git a/pkgs/development/python-modules/httplib2/default.nix b/pkgs/development/python-modules/httplib2/default.nix index f8e04b37146d..9a2201ae6969 100644 --- a/pkgs/development/python-modules/httplib2/default.nix +++ b/pkgs/development/python-modules/httplib2/default.nix @@ -6,6 +6,7 @@ fetchFromGitHub, mock, pyparsing, + pytest-cov-stub, pytest-forked, pytest-randomly, pytest-timeout, @@ -26,15 +27,12 @@ buildPythonPackage rec { hash = "sha256-76gdiRbF535CEaNXwNqsVeVc0dKglovMPQpGsOkbd/4="; }; - postPatch = '' - sed -i "/--cov/d" setup.cfg - ''; - propagatedBuildInputs = [ pyparsing ]; nativeCheckInputs = [ cryptography mock + pytest-cov-stub pytest-forked pytest-randomly pytest-timeout diff --git a/pkgs/development/python-modules/httpx-ws/default.nix b/pkgs/development/python-modules/httpx-ws/default.nix index d2277484781e..226bf83b4940 100644 --- a/pkgs/development/python-modules/httpx-ws/default.nix +++ b/pkgs/development/python-modules/httpx-ws/default.nix @@ -7,6 +7,7 @@ httpcore, httpx, pytestCheckHook, + pytest-cov-stub, pythonOlder, starlette, trio, @@ -33,8 +34,7 @@ buildPythonPackage rec { substituteInPlace pyproject.toml \ --replace-fail 'source = "regex_commit"' "" \ --replace-fail 'commit_extra_args = ["-e"]' "" \ - --replace-fail '"hatch-regex-commit"' "" \ - --replace-fail 'addopts = "--cov=httpx_ws/ --cov-report=term-missing"' "" + --replace-fail '"hatch-regex-commit"' "" ''; build-system = [ hatchling ]; @@ -48,6 +48,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub starlette trio uvicorn diff --git a/pkgs/development/python-modules/ibis-framework/default.nix b/pkgs/development/python-modules/ibis-framework/default.nix index 7d10c0d4c3d5..a68bfb2bbf0b 100644 --- a/pkgs/development/python-modules/ibis-framework/default.nix +++ b/pkgs/development/python-modules/ibis-framework/default.nix @@ -144,6 +144,7 @@ buildPythonPackage rec { ] ++ lib.concatMap (name: optional-dependencies.${name}) testBackends; pytestFlagsArray = [ + "--benchmark-disable" "-m" "'${lib.concatStringsSep " or " testBackends} or core'" ]; diff --git a/pkgs/development/python-modules/ical/default.nix b/pkgs/development/python-modules/ical/default.nix index 4ae8f0d97060..df8529462978 100644 --- a/pkgs/development/python-modules/ical/default.nix +++ b/pkgs/development/python-modules/ical/default.nix @@ -46,6 +46,8 @@ buildPythonPackage rec { syrupy ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + pythonImportsCheck = [ "ical" ]; meta = { diff --git a/pkgs/development/python-modules/ipfshttpclient/default.nix b/pkgs/development/python-modules/ipfshttpclient/default.nix index 263870816dab..06b95c8d12d9 100644 --- a/pkgs/development/python-modules/ipfshttpclient/default.nix +++ b/pkgs/development/python-modules/ipfshttpclient/default.nix @@ -71,8 +71,6 @@ buildPythonPackage rec { substituteInPlace test/functional/test_other.py \ --replace 'import ipfshttpclient' 'import ipfshttpclient; import pytest' \ --replace 'assert ipfs_is_available' 'pytest.skip("Unknown test failure with IPFS >=0.11.0"); assert ipfs_is_available' - substituteInPlace test/run-tests.py \ - --replace '--cov-fail-under=90' '--cov-fail-under=75' ''; checkPhase = '' diff --git a/pkgs/development/python-modules/jproperties/default.nix b/pkgs/development/python-modules/jproperties/default.nix index 83ba9855a0e2..f629bdeaf4ba 100644 --- a/pkgs/development/python-modules/jproperties/default.nix +++ b/pkgs/development/python-modules/jproperties/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, pytestCheckHook, six, + pytest-cov-stub, pytest-datadir, setuptools-scm, }: @@ -25,6 +26,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ six ]; nativeCheckInputs = [ + pytest-cov-stub pytest-datadir pytestCheckHook ]; @@ -32,8 +34,6 @@ buildPythonPackage rec { postPatch = '' substituteInPlace setup.py \ --replace "setuptools_scm ~= 3.3" "setuptools_scm" - substituteInPlace pytest.ini \ - --replace "--cov=jproperties --cov-report=term --cov-report=html --cov-branch" "" ''; disabledTestPaths = [ diff --git a/pkgs/development/python-modules/jsonschema-spec/default.nix b/pkgs/development/python-modules/jsonschema-spec/default.nix index eb6bb1030e62..1358e9282ed2 100644 --- a/pkgs/development/python-modules/jsonschema-spec/default.nix +++ b/pkgs/development/python-modules/jsonschema-spec/default.nix @@ -15,6 +15,7 @@ # tests pytestCheckHook, + pytest-cov-stub, responses, }: @@ -33,8 +34,6 @@ buildPythonPackage rec { }; postPatch = '' - sed -i "/^--cov/d" pyproject.toml - substituteInPlace pyproject.toml \ --replace 'referencing = ">=0.28.0,<0.30.0"' 'referencing = ">=0.28.0"' ''; @@ -54,6 +53,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub responses ]; diff --git a/pkgs/development/python-modules/kasa-crypt/default.nix b/pkgs/development/python-modules/kasa-crypt/default.nix index a35f628a3cef..3aac26418377 100644 --- a/pkgs/development/python-modules/kasa-crypt/default.nix +++ b/pkgs/development/python-modules/kasa-crypt/default.nix @@ -5,6 +5,7 @@ cython, poetry-core, pytestCheckHook, + pytest-cov-stub, setuptools, pythonOlder, }: @@ -23,18 +24,16 @@ buildPythonPackage rec { hash = "sha256-PQycv0JHXKIEzuKVnXoyuU/BfKG19r3eDE4rYDiYYaY="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail " --cov=kasa_crypt --cov-report=term-missing:skip-covered" "" - ''; - build-system = [ cython poetry-core setuptools ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "kasa_crypt" ]; diff --git a/pkgs/development/python-modules/kiss-headers/default.nix b/pkgs/development/python-modules/kiss-headers/default.nix index 3263941c69b6..3bc40680fb7e 100644 --- a/pkgs/development/python-modules/kiss-headers/default.nix +++ b/pkgs/development/python-modules/kiss-headers/default.nix @@ -5,6 +5,7 @@ hatchling, requests, pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -23,12 +24,10 @@ buildPythonPackage rec { propagatedBuildInputs = [ requests ]; - nativeCheckInputs = [ pytestCheckHook ]; - - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "--cov=kiss_headers --doctest-modules --cov-report=term-missing -rxXs" "--doctest-modules -rxXs" - ''; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; disabledTestPaths = [ # Tests require internet access diff --git a/pkgs/development/python-modules/knocki/default.nix b/pkgs/development/python-modules/knocki/default.nix index 82e4c4985ca1..44ddf26a0b19 100644 --- a/pkgs/development/python-modules/knocki/default.nix +++ b/pkgs/development/python-modules/knocki/default.nix @@ -10,6 +10,7 @@ pythonOlder, pytestCheckHook, pytest-aiohttp, + pytest-cov-stub, syrupy, yarl, }: @@ -28,11 +29,6 @@ buildPythonPackage rec { hash = "sha256-85w+fj00VW0miNt+xRMcU6szg/Z7QaeKLGw2BV7X0T4="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "addopts = \"--cov\"" "" - ''; - build-system = [ poetry-core ]; dependencies = [ @@ -46,6 +42,7 @@ buildPythonPackage rec { aioresponses pytestCheckHook pytest-aiohttp + pytest-cov-stub syrupy ]; diff --git a/pkgs/development/python-modules/kotsu/default.nix b/pkgs/development/python-modules/kotsu/default.nix index 9add6e9733a3..30063a80fd65 100644 --- a/pkgs/development/python-modules/kotsu/default.nix +++ b/pkgs/development/python-modules/kotsu/default.nix @@ -6,6 +6,7 @@ pandas, typing-extensions, pytestCheckHook, + pytest-cov-stub, pytest-mock, scikit-learn, }: @@ -24,8 +25,6 @@ buildPythonPackage rec { hash = "sha256-V5OkgiLUTRNbNt6m94+aYUZd9Nw+/60LfhrqqdFhiUw="; }; - patches = [ ./disable-pytest-coverage-flags.patch ]; - propagatedBuildInputs = [ pandas typing-extensions @@ -33,6 +32,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub pytest-mock scikit-learn ]; diff --git a/pkgs/development/python-modules/kotsu/disable-pytest-coverage-flags.patch b/pkgs/development/python-modules/kotsu/disable-pytest-coverage-flags.patch deleted file mode 100644 index f035ab0e6553..000000000000 --- a/pkgs/development/python-modules/kotsu/disable-pytest-coverage-flags.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/setup.cfg b/setup.cfg -index 3ab277a..b253e18 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -50,13 +50,6 @@ convention = google - add_ignore = D105, D107 - #add_ignore = D100,D101,D102,D103,D104,D200 - start with no ignored errors and add as required - --[tool:pytest] --addopts = --cov=./kotsu --cov-report xml --cov-report term -- --[coverage:run] --# Omit auto-generated versioneer file from test coverage --omit = kotsu/_version.py -- - [versioneer] - VCS = git - style = pep440 diff --git a/pkgs/development/python-modules/labelbox/default.nix b/pkgs/development/python-modules/labelbox/default.nix index 0c0737abdead..6565180a4b0d 100644 --- a/pkgs/development/python-modules/labelbox/default.nix +++ b/pkgs/development/python-modules/labelbox/default.nix @@ -48,11 +48,6 @@ let build-system = [ hatchling ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--durations=20 --cov=lbox.example" "--durations=20" - ''; - dependencies = [ google-api-core requests @@ -60,6 +55,7 @@ let nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub ]; doCheck = true; diff --git a/pkgs/development/python-modules/langchain-aws/default.nix b/pkgs/development/python-modules/langchain-aws/default.nix index 7101aa562733..d25dc5584a1b 100644 --- a/pkgs/development/python-modules/langchain-aws/default.nix +++ b/pkgs/development/python-modules/langchain-aws/default.nix @@ -16,6 +16,7 @@ # tests langchain-tests, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, }: @@ -33,8 +34,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace-fail "--snapshot-warn-unused" "" \ - --replace-fail "--cov=langchain_aws" "" + --replace-fail "--snapshot-warn-unused" "" substituteInPlace tests/unit_tests/{test_standard.py,chat_models/test_bedrock_converse.py} \ --replace-fail "langchain_standard_tests" "langchain_tests" ''; @@ -61,6 +61,7 @@ buildPythonPackage rec { nativeCheckInputs = [ langchain-tests pytest-asyncio + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/langchain-openai/default.nix b/pkgs/development/python-modules/langchain-openai/default.nix index 6710daa6e852..f86a67530e72 100644 --- a/pkgs/development/python-modules/langchain-openai/default.nix +++ b/pkgs/development/python-modules/langchain-openai/default.nix @@ -17,6 +17,7 @@ lark, pandas, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pytest-mock, pytest-socket, @@ -43,11 +44,6 @@ buildPythonPackage rec { sourceRoot = "${src.name}/libs/partners/openai"; - preConfigure = '' - substituteInPlace pyproject.toml \ - --replace-fail "--cov=langchain_openai" "" - ''; - build-system = [ pdm-backend ]; pythonRelaxDeps = [ @@ -68,6 +64,7 @@ buildPythonPackage rec { lark pandas pytest-asyncio + pytest-cov-stub pytestCheckHook pytest-mock pytest-socket diff --git a/pkgs/development/python-modules/latex2mathml/default.nix b/pkgs/development/python-modules/latex2mathml/default.nix index bbc45d55b25c..790696697541 100644 --- a/pkgs/development/python-modules/latex2mathml/default.nix +++ b/pkgs/development/python-modules/latex2mathml/default.nix @@ -5,6 +5,7 @@ fetchFromGitHub, poetry-core, pytestCheckHook, + pytest-cov-stub, multidict, xmljson, }: @@ -27,15 +28,11 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub multidict xmljson ]; - # Disable code coverage in check phase - postPatch = '' - sed -i '/--cov/d' pyproject.toml - ''; - pythonImportsCheck = [ "latex2mathml" ]; meta = { diff --git a/pkgs/development/python-modules/lcgit/default.nix b/pkgs/development/python-modules/lcgit/default.nix index e7fc4a064d59..ae95a334fe19 100644 --- a/pkgs/development/python-modules/lcgit/default.nix +++ b/pkgs/development/python-modules/lcgit/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, pytestCheckHook, + pytest-cov-stub, pythonOlder, setuptools, }: @@ -21,14 +22,12 @@ buildPythonPackage rec { hash = "sha256-unw5xY5iZlVrV01hchHS3Ar+zpF7awTAutcqndKH0Ic="; }; - postPatch = '' - substituteInPlace pytest.ini \ - --replace-fail " --cov" "" - ''; - build-system = [ setuptools ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "lcgit" ]; diff --git a/pkgs/development/python-modules/libipld/default.nix b/pkgs/development/python-modules/libipld/default.nix index a4a478104737..aa3e40381c24 100644 --- a/pkgs/development/python-modules/libipld/default.nix +++ b/pkgs/development/python-modules/libipld/default.nix @@ -49,6 +49,8 @@ buildPythonPackage rec { pytest-xdist ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + disabledTests = [ # touches network "test_decode_car" diff --git a/pkgs/development/python-modules/limits/default.nix b/pkgs/development/python-modules/limits/default.nix index d9aed3620d1d..d7f7d55ce343 100644 --- a/pkgs/development/python-modules/limits/default.nix +++ b/pkgs/development/python-modules/limits/default.nix @@ -100,6 +100,8 @@ buildPythonPackage rec { pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies); + pytestFlagsArray = [ "--benchmark-disable" ]; + disabledTests = [ "test_moving_window_memcached" ]; pythonImportsCheck = [ "limits" ]; diff --git a/pkgs/development/python-modules/lmfit/default.nix b/pkgs/development/python-modules/lmfit/default.nix index 87e201634e7b..83ff265b6922 100644 --- a/pkgs/development/python-modules/lmfit/default.nix +++ b/pkgs/development/python-modules/lmfit/default.nix @@ -7,6 +7,7 @@ matplotlib, numpy, pandas, + pytest-cov-stub, pytestCheckHook, pythonOlder, scipy, @@ -27,11 +28,6 @@ buildPythonPackage rec { hash = "sha256-czIea4gfL2hiNXIaffwCr2uw8DCiXv62Zjj2KxxgU6E="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "--cov=lmfit --cov-report html" "" - ''; - build-system = [ setuptools setuptools-scm @@ -48,6 +44,7 @@ buildPythonPackage rec { nativeCheckInputs = [ matplotlib pandas + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/luddite/default.nix b/pkgs/development/python-modules/luddite/default.nix index 5a421d68218a..a41e37244d66 100644 --- a/pkgs/development/python-modules/luddite/default.nix +++ b/pkgs/development/python-modules/luddite/default.nix @@ -5,6 +5,7 @@ setuptools, packaging, pytestCheckHook, + pytest-cov-stub, pytest-mock, }: @@ -22,7 +23,6 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pytest.ini \ - --replace "--cov=luddite --cov-report=html --cov-report=term --no-cov-on-fail" "" \ --replace "--disable-socket" "" ''; @@ -34,6 +34,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub pytest-mock ]; diff --git a/pkgs/development/python-modules/mcstatus/default.nix b/pkgs/development/python-modules/mcstatus/default.nix index 92912f5f477a..311caa582bce 100644 --- a/pkgs/development/python-modules/mcstatus/default.nix +++ b/pkgs/development/python-modules/mcstatus/default.nix @@ -8,6 +8,7 @@ poetry-dynamic-versioning, pytest-asyncio, pytest-rerunfailures, + pytest-cov-stub, pytestCheckHook, pythonOlder, }: @@ -26,11 +27,6 @@ buildPythonPackage rec { hash = "sha256-P8Su5P/ztyoXZBVvm5uCMDn4ezeg11oRSQ0QCyIJbVw="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace " --cov=mcstatus --cov-append --cov-branch --cov-report=term-missing -vvv --no-cov-on-fail" "" - ''; - nativeBuildInputs = [ poetry-core poetry-dynamic-versioning @@ -46,6 +42,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytest-rerunfailures + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/measurement/default.nix b/pkgs/development/python-modules/measurement/default.nix index ea4d1bf315b7..cbbea4d9189a 100644 --- a/pkgs/development/python-modules/measurement/default.nix +++ b/pkgs/development/python-modules/measurement/default.nix @@ -7,6 +7,7 @@ flit-scm, sympy, pytestCheckHook, + pytest-cov-stub, sphinx, }: @@ -30,14 +31,12 @@ buildPythonPackage rec { sphinx ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--cov=measurement" "" - ''; - propagatedBuildInputs = [ sympy ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; meta = { description = "Use and manipulate unit-aware measurement objects in Python"; diff --git a/pkgs/development/python-modules/mocket/default.nix b/pkgs/development/python-modules/mocket/default.nix index f4f048060795..78ff2568640d 100644 --- a/pkgs/development/python-modules/mocket/default.nix +++ b/pkgs/development/python-modules/mocket/default.nix @@ -77,7 +77,7 @@ buildPythonPackage rec { # Skip http tests, they require network access env.SKIP_TRUE_HTTP = true; - _darwinAllowLocalNetworking = true; + __darwinAllowLocalNetworking = true; disabledTests = [ diff --git a/pkgs/development/python-modules/motioneye-client/default.nix b/pkgs/development/python-modules/motioneye-client/default.nix index 8af5521584c1..4ab36924c061 100644 --- a/pkgs/development/python-modules/motioneye-client/default.nix +++ b/pkgs/development/python-modules/motioneye-client/default.nix @@ -6,6 +6,7 @@ fetchFromGitHub, poetry-core, pytest-aiohttp, + pytest-cov-stub, pytest-timeout, pytestCheckHook, pythonOlder, @@ -27,8 +28,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace 'aiohttp = "^3.8.1,!=3.8.2,!=3.8.3"' 'aiohttp = "*"' \ - --replace " --cov-report=html:htmlcov --cov-report=xml:coverage.xml --cov-report=term-missing --cov=motioneye_client --cov-fail-under=100" "" + --replace 'aiohttp = "^3.8.1,!=3.8.2,!=3.8.3"' 'aiohttp = "*"' ''; nativeBuildInputs = [ poetry-core ]; @@ -37,6 +37,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-aiohttp + pytest-cov-stub pytest-timeout pytestCheckHook ]; diff --git a/pkgs/development/python-modules/mt-940/default.nix b/pkgs/development/python-modules/mt-940/default.nix index fbc655387c89..74d296b53d81 100644 --- a/pkgs/development/python-modules/mt-940/default.nix +++ b/pkgs/development/python-modules/mt-940/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, pytestCheckHook, + pytest-cov-stub, pythonOlder, pyyaml, setuptools, @@ -22,16 +23,12 @@ buildPythonPackage rec { hash = "sha256-t6FOMu+KcEib+TZAv5uVAzvrUSt/k/RQn28jpdAY5Y0="; }; - postPatch = '' - sed -i "/--cov/d" pytest.ini - sed -i "/--no-cov/d" pytest.ini - ''; - nativeBuildInputs = [ setuptools ]; nativeCheckInputs = [ pyyaml pytestCheckHook + pytest-cov-stub ]; pythonImportsCheck = [ "mt940" ]; diff --git a/pkgs/development/python-modules/newick/default.nix b/pkgs/development/python-modules/newick/default.nix index ccda2606a56f..a45ae6c25294 100644 --- a/pkgs/development/python-modules/newick/default.nix +++ b/pkgs/development/python-modules/newick/default.nix @@ -5,6 +5,7 @@ setuptools-scm, pythonOlder, pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -22,12 +23,10 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools-scm ]; - postPatch = '' - # remove coverage arguments to pytest - sed -i '/--cov/d' setup.cfg - ''; - - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "newick" ]; diff --git a/pkgs/development/python-modules/nikola/default.nix b/pkgs/development/python-modules/nikola/default.nix index 955679a5b860..e4a490760249 100644 --- a/pkgs/development/python-modules/nikola/default.nix +++ b/pkgs/development/python-modules/nikola/default.nix @@ -29,6 +29,7 @@ pyphen, pyrss2gen, pytestCheckHook, + pytest-cov-stub, python-dateutil, pythonOlder, requests, @@ -54,11 +55,6 @@ buildPythonPackage rec { hash = "sha256-IfJB2Rl3c1MyEiuyNpT3udfpM480VvFD8zosJFDHr7k="; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace-fail "--cov nikola --cov-report term-missing" "" - ''; - nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ @@ -100,6 +96,7 @@ buildPythonPackage rec { freezegun mock pytestCheckHook + pytest-cov-stub ]; disabledTests = [ diff --git a/pkgs/development/python-modules/nplusone/default.nix b/pkgs/development/python-modules/nplusone/default.nix index 76b22857f172..5ddd76f88333 100644 --- a/pkgs/development/python-modules/nplusone/default.nix +++ b/pkgs/development/python-modules/nplusone/default.nix @@ -11,6 +11,7 @@ peewee, pytest-django, pytestCheckHook, + pytest-cov-stub, six, sqlalchemy, webtest, @@ -41,6 +42,7 @@ buildPythonPackage rec { peewee pytest-django pytestCheckHook + pytest-cov-stub sqlalchemy webtest ]; @@ -55,8 +57,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pytest.ini \ - --replace "python_paths" "pythonpath" \ - --replace "--cov nplusone --cov-report term-missing" "" + --replace "python_paths" "pythonpath" ''; disabledTests = [ diff --git a/pkgs/development/python-modules/numbagg/default.nix b/pkgs/development/python-modules/numbagg/default.nix index a84baf2107c2..fc0fa55f0718 100644 --- a/pkgs/development/python-modules/numbagg/default.nix +++ b/pkgs/development/python-modules/numbagg/default.nix @@ -54,6 +54,8 @@ buildPythonPackage rec { pytest-benchmark ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + meta = { description = "Fast N-dimensional aggregation functions with Numba"; homepage = "https://github.com/numbagg/numbagg"; diff --git a/pkgs/development/python-modules/omnikinverter/default.nix b/pkgs/development/python-modules/omnikinverter/default.nix index 190f8d700500..4557405a6331 100644 --- a/pkgs/development/python-modules/omnikinverter/default.nix +++ b/pkgs/development/python-modules/omnikinverter/default.nix @@ -6,6 +6,7 @@ fetchFromGitHub, poetry-core, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, yarl, @@ -30,8 +31,7 @@ buildPythonPackage rec { postPatch = '' # Upstream doesn't set a version for the pyproject.toml substituteInPlace pyproject.toml \ - --replace "0.0.0" "${version}" \ - --replace "--cov" "" + --replace "0.0.0" "${version}" ''; nativeBuildInputs = [ poetry-core ]; @@ -44,6 +44,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aresponses pytest-asyncio + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/openapi-schema-validator/default.nix b/pkgs/development/python-modules/openapi-schema-validator/default.nix index 7a40cc690de8..2cc663198996 100644 --- a/pkgs/development/python-modules/openapi-schema-validator/default.nix +++ b/pkgs/development/python-modules/openapi-schema-validator/default.nix @@ -14,6 +14,7 @@ # tests pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -30,10 +31,6 @@ buildPythonPackage rec { hash = "sha256-1Y049W4TbqvKZRwnvPVwyLq6CH6NQDrEfJknuMn8dGo="; }; - postPatch = '' - sed -i "/--cov/d" pyproject.toml - ''; - nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ @@ -42,7 +39,10 @@ buildPythonPackage rec { rfc3339-validator ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; disabledTests = [ # https://github.com/python-openapi/openapi-schema-validator/issues/153 diff --git a/pkgs/development/python-modules/openapi-spec-validator/default.nix b/pkgs/development/python-modules/openapi-spec-validator/default.nix index 0086d6098141..425df62257c6 100644 --- a/pkgs/development/python-modules/openapi-spec-validator/default.nix +++ b/pkgs/development/python-modules/openapi-spec-validator/default.nix @@ -16,6 +16,7 @@ # tests pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -33,10 +34,6 @@ buildPythonPackage rec { hash = "sha256-X0ePdHQeBSWjsCFQgCoNloQZRhKbvPBE43aavBppvmg="; }; - postPatch = '' - sed -i '/--cov/d' pyproject.toml - ''; - nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ @@ -46,7 +43,10 @@ buildPythonPackage rec { openapi-schema-validator ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; disabledTests = [ # network access diff --git a/pkgs/development/python-modules/opentelemetry-propagator-aws-xray/default.nix b/pkgs/development/python-modules/opentelemetry-propagator-aws-xray/default.nix index 4ef467cc7230..c00498f74cec 100644 --- a/pkgs/development/python-modules/opentelemetry-propagator-aws-xray/default.nix +++ b/pkgs/development/python-modules/opentelemetry-propagator-aws-xray/default.nix @@ -26,13 +26,12 @@ buildPythonPackage { nativeCheckInputs = [ opentelemetry-test-utils pytestCheckHook - ]; - - checkInputs = [ pytest-benchmark requests ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + pythonImportsCheck = [ "opentelemetry.propagators.aws" ]; meta = opentelemetry-instrumentation.meta // { diff --git a/pkgs/development/python-modules/p1monitor/default.nix b/pkgs/development/python-modules/p1monitor/default.nix index 894ae80ff73e..31fc23cb930d 100644 --- a/pkgs/development/python-modules/p1monitor/default.nix +++ b/pkgs/development/python-modules/p1monitor/default.nix @@ -6,6 +6,7 @@ fetchFromGitHub, poetry-core, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, syrupy, pythonOlder, @@ -28,8 +29,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace '"0.0.0"' '"${version}"' \ - --replace 'addopts = "--cov"' "" + --replace '"0.0.0"' '"${version}"' ''; build-system = [ poetry-core ]; @@ -42,6 +42,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aresponses pytest-asyncio + pytest-cov-stub pytestCheckHook syrupy ]; diff --git a/pkgs/development/python-modules/papis/default.nix b/pkgs/development/python-modules/papis/default.nix index 15ec1e8c14d3..e791700751fe 100644 --- a/pkgs/development/python-modules/papis/default.nix +++ b/pkgs/development/python-modules/papis/default.nix @@ -31,6 +31,7 @@ docutils, git, pytestCheckHook, + pytest-cov-stub, sphinx, sphinx-click, }: @@ -70,17 +71,13 @@ buildPythonPackage rec { stevedore ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "--cov=papis" "" - ''; - pythonImportsCheck = [ "papis" ]; nativeCheckInputs = [ docutils git pytestCheckHook + pytest-cov-stub sphinx sphinx-click ]; diff --git a/pkgs/development/python-modules/pastedeploy/default.nix b/pkgs/development/python-modules/pastedeploy/default.nix index 945a07d525dd..722ff6f8b4be 100644 --- a/pkgs/development/python-modules/pastedeploy/default.nix +++ b/pkgs/development/python-modules/pastedeploy/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, pytestCheckHook, + pytest-cov-stub, pythonOlder, setuptools, }: @@ -21,14 +22,12 @@ buildPythonPackage rec { hash = "sha256-yR7UxAeF0fQrbU7tl29GpPeEAc4YcxHdNQWMD67pP3g="; }; - postPatch = '' - substituteInPlace pytest.ini \ - --replace-fail " --cov" "" - ''; - build-system = [ setuptools ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "paste.deploy" ]; diff --git a/pkgs/development/python-modules/pathable/default.nix b/pkgs/development/python-modules/pathable/default.nix index d6d92204c424..4bc3de530787 100644 --- a/pkgs/development/python-modules/pathable/default.nix +++ b/pkgs/development/python-modules/pathable/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, pytestCheckHook, + pytest-cov-stub, pythonOlder, poetry-core, }: @@ -23,11 +24,10 @@ buildPythonPackage rec { nativeBuildInputs = [ poetry-core ]; - nativeCheckInputs = [ pytestCheckHook ]; - - postPatch = '' - sed -i "/--cov/d" pyproject.toml - ''; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "pathable" ]; diff --git a/pkgs/development/python-modules/pilkit/default.nix b/pkgs/development/python-modules/pilkit/default.nix index a69b688ad538..b7a2f6130586 100644 --- a/pkgs/development/python-modules/pilkit/default.nix +++ b/pkgs/development/python-modules/pilkit/default.nix @@ -5,6 +5,7 @@ mock, pillow, pytestCheckHook, + pytest-cov-stub, pythonOlder, setuptools, }: @@ -30,11 +31,10 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook + pytest-cov-stub ]; postPatch = '' - substituteInPlace tox.ini \ - --replace " --cov --cov-report term-missing:skip-covered" "" substituteInPlace pilkit/processors/resize.py \ --replace "Image.ANTIALIAS" "Image.Resampling.LANCZOS" ''; diff --git a/pkgs/development/python-modules/plotnine/default.nix b/pkgs/development/python-modules/plotnine/default.nix index 98e168fd2cf5..c0b78aee6ccf 100644 --- a/pkgs/development/python-modules/plotnine/default.nix +++ b/pkgs/development/python-modules/plotnine/default.nix @@ -17,6 +17,7 @@ # tests geopandas, pytestCheckHook, + pytest-cov-stub, scikit-misc, }: @@ -32,11 +33,6 @@ buildPythonPackage rec { hash = "sha256-3ImNLmZ8RhhqRGv/FtdjbHmdOtgQC7hjUsViEQYE8Ao="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail " --cov=plotnine --cov-report=xml" "" - ''; - build-system = [ setuptools-scm ]; dependencies = [ @@ -51,6 +47,7 @@ buildPythonPackage rec { nativeCheckInputs = [ geopandas pytestCheckHook + pytest-cov-stub scikit-misc ]; diff --git a/pkgs/development/python-modules/polars/default.nix b/pkgs/development/python-modules/polars/default.nix index 5e82dbcf1641..0cbeee4d65a1 100644 --- a/pkgs/development/python-modules/polars/default.nix +++ b/pkgs/development/python-modules/polars/default.nix @@ -235,6 +235,7 @@ buildPythonPackage rec { ]; pytestFlagsArray = [ + "--benchmark-disable" "-n auto" "--dist loadgroup" ''-m "slow or not slow"'' diff --git a/pkgs/development/python-modules/polyline/default.nix b/pkgs/development/python-modules/polyline/default.nix index 34bc7a5ceba2..7e1ab2c2e40c 100644 --- a/pkgs/development/python-modules/polyline/default.nix +++ b/pkgs/development/python-modules/polyline/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, pytestCheckHook, + pytest-cov-stub, pythonOlder, setuptools, wheel, @@ -22,17 +23,15 @@ buildPythonPackage rec { hash = "sha256-fbGGfZdme4OiIGNlXG1uVl1xP+rPVI9l5hjHM0gwAsE="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace " --cov=polyline --cov-report term-missing" "" - ''; - nativeBuildInputs = [ setuptools wheel ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "polyline" ]; diff --git a/pkgs/development/python-modules/portalocker/default.nix b/pkgs/development/python-modules/portalocker/default.nix index 87d15c946a34..cb01274dfea1 100644 --- a/pkgs/development/python-modules/portalocker/default.nix +++ b/pkgs/development/python-modules/portalocker/default.nix @@ -13,6 +13,7 @@ # tests pygments, + pytest-cov-stub, pytestCheckHook, }: @@ -28,10 +29,6 @@ buildPythonPackage rec { hash = "sha256-7CD23aKtnOifo5ml8x9PFJX1FZWPDLfKZUPO97tadJ4="; }; - postPatch = '' - sed -i "/--cov/d" pytest.ini - ''; - nativeBuildInputs = [ setuptools setuptools-scm @@ -41,6 +38,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pygments + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/pot/default.nix b/pkgs/development/python-modules/pot/default.nix index eaada3958019..8767a7f56239 100644 --- a/pkgs/development/python-modules/pot/default.nix +++ b/pkgs/development/python-modules/pot/default.nix @@ -11,6 +11,7 @@ numpy, pymanopt, pytestCheckHook, + pytest-cov-stub, pythonOlder, scikit-learn, scipy, @@ -79,11 +80,13 @@ buildPythonPackage rec { ); }; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; postPatch = '' substituteInPlace setup.cfg \ - --replace " --cov-report= --cov=ot" "" \ --replace " --durations=20" "" \ --replace " --junit-xml=junit-results.xml" "" diff --git a/pkgs/development/python-modules/py7zr/default.nix b/pkgs/development/python-modules/py7zr/default.nix index e852a8317212..e8fbd5dbafb3 100644 --- a/pkgs/development/python-modules/py7zr/default.nix +++ b/pkgs/development/python-modules/py7zr/default.nix @@ -65,6 +65,8 @@ buildPythonPackage rec { pytestCheckHook ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + pythonImportsCheck = [ "py7zr" ]; diff --git a/pkgs/development/python-modules/pydash/default.nix b/pkgs/development/python-modules/pydash/default.nix index 356ce206b1de..27f1675ccdf3 100644 --- a/pkgs/development/python-modules/pydash/default.nix +++ b/pkgs/development/python-modules/pydash/default.nix @@ -5,6 +5,7 @@ invoke, mock, pytest7CheckHook, + pytest-cov-stub, pythonOlder, setuptools, sphinx-rtd-theme, @@ -25,11 +26,6 @@ buildPythonPackage rec { hash = "sha256-4zNljz0U/iQd2DMC43qkdOY/mwtPlizgLmoaB7BVmxw="; }; - postPatch = '' - sed -i "/--cov/d" pyproject.toml - sed -i "/--no-cov/d" pyproject.toml - ''; - build-system = [ setuptools ]; dependencies = [ typing-extensions ]; @@ -38,6 +34,7 @@ buildPythonPackage rec { invoke mock pytest7CheckHook + pytest-cov-stub sphinx-rtd-theme ]; diff --git a/pkgs/development/python-modules/pyecoforest/default.nix b/pkgs/development/python-modules/pyecoforest/default.nix index b0634ee82a1c..46625f351a13 100644 --- a/pkgs/development/python-modules/pyecoforest/default.nix +++ b/pkgs/development/python-modules/pyecoforest/default.nix @@ -5,6 +5,7 @@ httpx, poetry-core, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, respx, @@ -24,17 +25,13 @@ buildPythonPackage rec { hash = "sha256-C8sFq0vsVsq6irWbRd0eq18tfKu0qRRBZHt23CiDTGU="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "--cov=pyecoforest --cov-report=term-missing:skip-covered" "" - ''; - build-system = [ poetry-core ]; dependencies = [ httpx ]; nativeCheckInputs = [ pytest-asyncio + pytest-cov-stub pytestCheckHook respx ]; diff --git a/pkgs/development/python-modules/pyipp/default.nix b/pkgs/development/python-modules/pyipp/default.nix index 27b52cbaaca2..63645b80a40e 100644 --- a/pkgs/development/python-modules/pyipp/default.nix +++ b/pkgs/development/python-modules/pyipp/default.nix @@ -10,6 +10,7 @@ fetchFromGitHub, poetry-core, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, syrupy, @@ -32,8 +33,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace-fail 'version = "0.0.0"' 'version = "${version}"' \ - --replace-fail "--cov" "" + --replace-fail 'version = "0.0.0"' 'version = "${version}"' ''; build-system = [ poetry-core ]; @@ -49,6 +49,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aresponses pytest-asyncio + pytest-cov-stub pytestCheckHook syrupy ]; diff --git a/pkgs/development/python-modules/pyloadapi/default.nix b/pkgs/development/python-modules/pyloadapi/default.nix index b93e07d8520c..81a3937c31b8 100644 --- a/pkgs/development/python-modules/pyloadapi/default.nix +++ b/pkgs/development/python-modules/pyloadapi/default.nix @@ -7,6 +7,7 @@ hatch-regex-commit, hatchling, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, python-dotenv, pythonOlder, @@ -26,11 +27,6 @@ buildPythonPackage rec { hash = "sha256-DkYbQB91KYskfm2yDVmR0/MJiixC2C5miHpTq7RpVBU="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "--cov=src/pyloadapi/ --cov-report=term-missing" "" - ''; - build-system = [ hatch-regex-commit hatchling @@ -41,6 +37,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aioresponses pytest-asyncio + pytest-cov-stub pytestCheckHook python-dotenv ]; diff --git a/pkgs/development/python-modules/pymemcache/default.nix b/pkgs/development/python-modules/pymemcache/default.nix index 6f570f8d8306..69e96b77011c 100644 --- a/pkgs/development/python-modules/pymemcache/default.nix +++ b/pkgs/development/python-modules/pymemcache/default.nix @@ -4,6 +4,7 @@ faker, fetchFromGitHub, mock, + pytest-cov-stub, pytestCheckHook, python-memcached, pythonOlder, @@ -31,15 +32,12 @@ buildPythonPackage rec { nativeCheckInputs = [ faker mock + pytest-cov-stub pytestCheckHook python-memcached zstd ]; - postPatch = '' - sed -i "/--cov/d" setup.cfg - ''; - disabledTests = lib.optionals stdenv.hostPlatform.is32bit [ # test_compressed_complex is broken on 32-bit platforms # this can be removed on the next version bump diff --git a/pkgs/development/python-modules/pypinyin/default.nix b/pkgs/development/python-modules/pypinyin/default.nix index 64f7b232b2f0..8e6f60b1a680 100644 --- a/pkgs/development/python-modules/pypinyin/default.nix +++ b/pkgs/development/python-modules/pypinyin/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, pytestCheckHook, + pytest-cov-stub, pythonOlder, }: @@ -20,12 +21,10 @@ buildPythonPackage rec { hash = "sha256-kA6h2CPGhoZt8h3KEttegHhmMqVc72IkrkA3PonY3sY="; }; - postPatch = '' - substituteInPlace pytest.ini --replace \ - "--cov-report term-missing" "" - ''; - - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pytestFlagsArray = [ "tests" ]; diff --git a/pkgs/development/python-modules/pyppmd/default.nix b/pkgs/development/python-modules/pyppmd/default.nix index 511b696e17d6..5cee2f5fde1c 100644 --- a/pkgs/development/python-modules/pyppmd/default.nix +++ b/pkgs/development/python-modules/pyppmd/default.nix @@ -35,6 +35,8 @@ buildPythonPackage rec { pytestCheckHook ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + pythonImportsCheck = [ "pyppmd" ]; diff --git a/pkgs/development/python-modules/pyramid-jinja2/default.nix b/pkgs/development/python-modules/pyramid-jinja2/default.nix index f15a3623ee23..d18f872c570b 100644 --- a/pkgs/development/python-modules/pyramid-jinja2/default.nix +++ b/pkgs/development/python-modules/pyramid-jinja2/default.nix @@ -6,6 +6,7 @@ markupsafe, jinja2, pytestCheckHook, + pytest-cov-stub, zope-deprecation, pyramid, pythonOlder, @@ -34,13 +35,9 @@ buildPythonPackage rec { nativeCheckInputs = [ webtest pytestCheckHook + pytest-cov-stub ]; - postPatch = '' - substituteInPlace setup.cfg \ - --replace " --cov" "" - ''; - pythonImportsCheck = [ "pyramid_jinja2" ]; disabledTests = [ diff --git a/pkgs/development/python-modules/pysnooz/default.nix b/pkgs/development/python-modules/pysnooz/default.nix index 8a45805015f8..7a0d35c59c9d 100644 --- a/pkgs/development/python-modules/pysnooz/default.nix +++ b/pkgs/development/python-modules/pysnooz/default.nix @@ -10,6 +10,7 @@ home-assistant-bluetooth, poetry-core, pytest-asyncio, + pytest-cov-stub, pytest-mock, pytestCheckHook, pythonOlder, @@ -33,8 +34,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ --replace 'transitions = "^0.8.11"' 'transitions = ">=0.8.11"' \ - --replace 'Events = "^0.4"' 'Events = ">=0.4"' \ - --replace " --cov=pysnooz --cov-report=term-missing:skip-covered" "" + --replace 'Events = "^0.4"' 'Events = ">=0.4"' ''; nativeBuildInputs = [ poetry-core ]; @@ -51,6 +51,7 @@ buildPythonPackage rec { nativeCheckInputs = [ freezegun pytest-asyncio + pytest-cov-stub pytest-mock pytestCheckHook ]; diff --git a/pkgs/development/python-modules/pystac-client/default.nix b/pkgs/development/python-modules/pystac-client/default.nix index cf752cf5a5bf..fe8cfca42d5e 100644 --- a/pkgs/development/python-modules/pystac-client/default.nix +++ b/pkgs/development/python-modules/pystac-client/default.nix @@ -47,6 +47,7 @@ buildPythonPackage rec { ]; pytestFlagsArray = [ + "--benchmark-disable" # Tests accessing Internet "-m 'not vcr'" ]; diff --git a/pkgs/development/python-modules/pytensor/default.nix b/pkgs/development/python-modules/pytensor/default.nix index c1d7b0e494fb..db645beaaba0 100644 --- a/pkgs/development/python-modules/pytensor/default.nix +++ b/pkgs/development/python-modules/pytensor/default.nix @@ -73,6 +73,8 @@ buildPythonPackage rec { writableTmpDirAsHomeHook ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + pythonImportsCheck = [ "pytensor" ]; # Ensure that the installed package is used instead of the source files from the current workdir diff --git a/pkgs/development/python-modules/python-barcode/default.nix b/pkgs/development/python-modules/python-barcode/default.nix index 432a910b95c6..8b80b8a06d65 100644 --- a/pkgs/development/python-modules/python-barcode/default.nix +++ b/pkgs/development/python-modules/python-barcode/default.nix @@ -6,6 +6,7 @@ setuptools-scm, pillow, pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -26,14 +27,10 @@ buildPythonPackage rec { images = [ pillow ]; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace "--cov=barcode" "" \ - --replace "--cov-report=term-missing:skip-covered" "" \ - --replace "--no-cov-on-fail" "" - ''; - - nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.images; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ] ++ optional-dependencies.images; pythonImportsCheck = [ "barcode" ]; diff --git a/pkgs/development/python-modules/python-escpos/default.nix b/pkgs/development/python-modules/python-escpos/default.nix index 894d07bc0044..c778e150e666 100644 --- a/pkgs/development/python-modules/python-escpos/default.nix +++ b/pkgs/development/python-modules/python-escpos/default.nix @@ -21,6 +21,7 @@ jaconv, pytestCheckHook, + pytest-cov-stub, pytest-mock, scripttest, mock, @@ -71,10 +72,6 @@ buildPythonPackage rec { # force the tests to use the module in $out rm -r src - # disable checking coverage - substituteInPlace pyproject.toml \ - --replace-fail "--cov escpos --cov-report=xml" "" - # allow tests to find the cli executable export PATH="$out/bin:$PATH" ''; @@ -82,6 +79,7 @@ buildPythonPackage rec { nativeCheckInputs = [ jaconv pytestCheckHook + pytest-cov-stub pytest-mock scripttest mock diff --git a/pkgs/development/python-modules/python-lsp-jsonrpc/default.nix b/pkgs/development/python-modules/python-lsp-jsonrpc/default.nix index cbca9a65a80d..b215e67e9cdb 100644 --- a/pkgs/development/python-modules/python-lsp-jsonrpc/default.nix +++ b/pkgs/development/python-modules/python-lsp-jsonrpc/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, pytestCheckHook, + pytest-cov-stub, pythonOlder, setuptools, setuptools-scm, @@ -23,11 +24,6 @@ buildPythonPackage rec { hash = "sha256-5WN/31e6WCgXVzevMuQbNjyo/2jjWDF+m48nrLKS+64="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--cov-report html --cov-report term --junitxml=pytest.xml --cov pylsp_jsonrpc --cov test" "" - ''; - nativeBuildInputs = [ setuptools setuptools-scm @@ -35,7 +31,10 @@ buildPythonPackage rec { propagatedBuildInputs = [ ujson ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "pylsp_jsonrpc" ]; diff --git a/pkgs/development/python-modules/python-matter-server/default.nix b/pkgs/development/python-modules/python-matter-server/default.nix index fe578226b3a1..ae9037129b1e 100644 --- a/pkgs/development/python-modules/python-matter-server/default.nix +++ b/pkgs/development/python-modules/python-matter-server/default.nix @@ -28,6 +28,7 @@ python, pytest, pytest-aiohttp, + pytest-cov-stub, pytestCheckHook, }: @@ -76,8 +77,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace 'version = "0.0.0"' 'version = "${version}"' \ - --replace '--cov' "" + --replace 'version = "0.0.0"' 'version = "${version}"' ''; build-system = [ @@ -107,6 +107,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aioresponses pytest-aiohttp + pytest-cov-stub pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies); diff --git a/pkgs/development/python-modules/python-olm/default.nix b/pkgs/development/python-modules/python-olm/default.nix index 642af55ed786..1a2ed41e55d6 100644 --- a/pkgs/development/python-modules/python-olm/default.nix +++ b/pkgs/development/python-modules/python-olm/default.nix @@ -38,6 +38,8 @@ buildPythonPackage { pytestCheckHook ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + meta = { inherit (olm.meta) license maintainers; description = "Python bindings for Olm"; diff --git a/pkgs/development/python-modules/python-opensky/default.nix b/pkgs/development/python-modules/python-opensky/default.nix index ab4b8fdcd678..f572a63c6679 100644 --- a/pkgs/development/python-modules/python-opensky/default.nix +++ b/pkgs/development/python-modules/python-opensky/default.nix @@ -7,6 +7,7 @@ poetry-core, pydantic, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, syrupy, @@ -29,8 +30,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace 'version = "0.0.0"' 'version = "${version}"' \ - --replace "--cov" "" + --replace 'version = "0.0.0"' 'version = "${version}"' substituteInPlace src/python_opensky/opensky.py \ --replace ".joinpath(uri)" "/ uri" ''; @@ -46,6 +46,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aresponses pytest-asyncio + pytest-cov-stub pytestCheckHook syrupy ]; diff --git a/pkgs/development/python-modules/python-stdnum/default.nix b/pkgs/development/python-modules/python-stdnum/default.nix index 15647160b525..c7acea928a81 100644 --- a/pkgs/development/python-modules/python-stdnum/default.nix +++ b/pkgs/development/python-modules/python-stdnum/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchPypi, pytestCheckHook, + pytest-cov-stub, pythonOlder, setuptools, zeep, @@ -20,14 +21,12 @@ buildPythonPackage rec { hash = "sha256-rSos8usCXeQIIQI182tK4xJS3jGGJAzKqBJuEXy4JpA="; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace-fail " --cov=stdnum --cov-report=term-missing:skip-covered --cov-report=html" "" - ''; - nativeBuildInputs = [ setuptools ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; optional-dependencies = { SOAP = [ zeep ]; diff --git a/pkgs/development/python-modules/pythonfinder/default.nix b/pkgs/development/python-modules/pythonfinder/default.nix index cb36ba8f2dba..f8883feef364 100644 --- a/pkgs/development/python-modules/pythonfinder/default.nix +++ b/pkgs/development/python-modules/pythonfinder/default.nix @@ -5,6 +5,7 @@ click, fetchFromGitHub, packaging, + pytest-cov-stub, pytest-timeout, pytestCheckHook, pythonOlder, @@ -25,11 +26,6 @@ buildPythonPackage rec { hash = "sha256-CbaKXD7Sde8euRqvc/IHoXoSMF+dNd7vT9LkLWq4/IU="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace " --cov" "" - ''; - nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ packaging ] ++ lib.optionals (pythonOlder "3.8") [ cached-property ]; @@ -39,6 +35,7 @@ buildPythonPackage rec { }; nativeCheckInputs = [ + pytest-cov-stub pytest-timeout pytestCheckHook ] ++ lib.flatten (builtins.attrValues optional-dependencies); diff --git a/pkgs/development/python-modules/pyxnat/default.nix b/pkgs/development/python-modules/pyxnat/default.nix index 3c7a50805264..2d5ae3787dbc 100644 --- a/pkgs/development/python-modules/pyxnat/default.nix +++ b/pkgs/development/python-modules/pyxnat/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, pythonOlder, pytestCheckHook, + pytest-cov-stub, lxml, matplotlib, networkx, @@ -37,11 +38,11 @@ buildPythonPackage rec { # pathlib is installed part of python38+ w/o an external package prePatch = '' substituteInPlace setup.py --replace-fail "pathlib>=1.0" "" - sed -i '/--cov/d' setup.cfg ''; nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub matplotlib networkx pandas diff --git a/pkgs/development/python-modules/pyzerproc/default.nix b/pkgs/development/python-modules/pyzerproc/default.nix index 79d3617e49f9..42c67a591965 100644 --- a/pkgs/development/python-modules/pyzerproc/default.nix +++ b/pkgs/development/python-modules/pyzerproc/default.nix @@ -7,6 +7,7 @@ pytest-asyncio, pytest-mock, pythonAtLeast, + pytest-cov-stub, pytestCheckHook, pythonOlder, }: @@ -25,10 +26,6 @@ buildPythonPackage rec { hash = "sha256-vS0sk/KjDhWispZvCuGlmVLLfeFymHqxwNzNqNRhg6k="; }; - postPatch = '' - sed -i "/--cov/d" setup.cfg - ''; - propagatedBuildInputs = [ bleak click @@ -37,6 +34,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytest-mock + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/ratelimit/default.nix b/pkgs/development/python-modules/ratelimit/default.nix index 0e4bdaca35c1..d754357081c9 100644 --- a/pkgs/development/python-modules/ratelimit/default.nix +++ b/pkgs/development/python-modules/ratelimit/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -17,11 +18,10 @@ buildPythonPackage rec { sha256 = "04hy3hhh5xdqcsz0lx8j18zbj88kh5ik4wyi5d3a5sfy2hx70in2"; }; - postPatch = '' - sed -i "/--cov/d" pytest.ini - ''; - - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pytestFlagsArray = [ "tests" ]; diff --git a/pkgs/development/python-modules/requests/CVE-2024-47081.patch b/pkgs/development/python-modules/requests/CVE-2024-47081.patch new file mode 100644 index 000000000000..61d722b9aa97 --- /dev/null +++ b/pkgs/development/python-modules/requests/CVE-2024-47081.patch @@ -0,0 +1,28 @@ +From 57acb7c26d809cf864ec439b8bcd6364702022d5 Mon Sep 17 00:00:00 2001 +From: Nate Prewitt +Date: Wed, 25 Sep 2024 08:03:20 -0700 +Subject: [PATCH] Only use hostname to do netrc lookup instead of netloc + +--- + src/requests/utils.py | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/src/requests/utils.py b/src/requests/utils.py +index 699683e5d9..8a307ca8a0 100644 +--- a/src/requests/utils.py ++++ b/src/requests/utils.py +@@ -236,13 +236,7 @@ def get_netrc_auth(url, raise_errors=False): + return + + ri = urlparse(url) +- +- # Strip port numbers from netloc. This weird `if...encode`` dance is +- # used for Python 3.2, which doesn't support unicode literals. +- splitstr = b":" +- if isinstance(url, str): +- splitstr = splitstr.decode("ascii") +- host = ri.netloc.split(splitstr)[0] ++ host = ri.hostname + + try: + _netrc = netrc(netrc_path).authenticators(host) diff --git a/pkgs/development/python-modules/requests/default.nix b/pkgs/development/python-modules/requests/default.nix index cc80e5bb0de0..99187427d880 100644 --- a/pkgs/development/python-modules/requests/default.nix +++ b/pkgs/development/python-modules/requests/default.nix @@ -33,6 +33,9 @@ buildPythonPackage rec { # https://github.com/psf/requests/issues/6730 # https://github.com/psf/requests/pull/6731 ./ca-load-regression.patch + + # https://seclists.org/fulldisclosure/2025/Jun/2 + ./CVE-2024-47081.patch ]; dependencies = [ diff --git a/pkgs/development/python-modules/respx/default.nix b/pkgs/development/python-modules/respx/default.nix index c2252ebebe85..866edec08888 100644 --- a/pkgs/development/python-modules/respx/default.nix +++ b/pkgs/development/python-modules/respx/default.nix @@ -6,6 +6,7 @@ httpcore, httpx, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, setuptools, @@ -27,10 +28,6 @@ buildPythonPackage rec { hash = "sha256-T3DLNXJykSF/HXjlmQdJ2CG4d+U1eTa+XWcgtT3dhl4="; }; - postPatch = '' - sed -i "/--cov/d" setup.cfg - ''; - build-system = [ setuptools ]; dependencies = [ httpx ]; @@ -40,6 +37,7 @@ buildPythonPackage rec { httpx flask pytest-asyncio + pytest-cov-stub pytestCheckHook starlette trio diff --git a/pkgs/development/python-modules/rokuecp/default.nix b/pkgs/development/python-modules/rokuecp/default.nix index 2578ea13531c..a1d885de22c2 100644 --- a/pkgs/development/python-modules/rokuecp/default.nix +++ b/pkgs/development/python-modules/rokuecp/default.nix @@ -9,6 +9,7 @@ fetchFromGitHub, poetry-core, pytest-asyncio, + pytest-cov-stub, pytest-freezegun, pytestCheckHook, pythonOlder, @@ -32,8 +33,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace-fail 'version = "0.0.0"' 'version = "${version}"' \ - --replace-fail "--cov" "" + --replace-fail 'version = "0.0.0"' 'version = "${version}"' ''; build-system = [ poetry-core ]; @@ -50,6 +50,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aresponses pytest-asyncio + pytest-cov-stub pytest-freezegun pytestCheckHook ]; diff --git a/pkgs/development/python-modules/scikit-rf/default.nix b/pkgs/development/python-modules/scikit-rf/default.nix index 6d2a4a8074c7..7948fe945b72 100644 --- a/pkgs/development/python-modules/scikit-rf/default.nix +++ b/pkgs/development/python-modules/scikit-rf/default.nix @@ -21,6 +21,7 @@ openpyxl, setuptools, pytestCheckHook, + pytest-cov-stub, pytest-mock, }: @@ -38,11 +39,6 @@ buildPythonPackage rec { hash = "sha256-Ovrr1U7VuuGKDNSBSCyYSz3DNpaJrA57ccl4AFdzC5E="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "--cov=skrf" "" - ''; - build-system = [ setuptools ]; dependencies = [ @@ -78,6 +74,7 @@ buildPythonPackage rec { openpyxl networkx pytestCheckHook + pytest-cov-stub ]; # test_calibration.py generates a divide by zero error on darwin diff --git a/pkgs/development/python-modules/segments/default.nix b/pkgs/development/python-modules/segments/default.nix index 322446fd0353..2430355860a0 100644 --- a/pkgs/development/python-modules/segments/default.nix +++ b/pkgs/development/python-modules/segments/default.nix @@ -8,6 +8,7 @@ csvw, clldutils, pytestCheckHook, + pytest-cov-stub, pytest-mock, }: @@ -24,11 +25,6 @@ buildPythonPackage rec { sha256 = "sha256-Z9AQnsK/0HUCZDzdpQKNfSBWxfAOjWNBytcfI6yBY84="; }; - patchPhase = '' - substituteInPlace setup.cfg \ - --replace-fail "--cov" "" - ''; - nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ @@ -39,6 +35,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub pytest-mock ]; diff --git a/pkgs/development/python-modules/semver/default.nix b/pkgs/development/python-modules/semver/default.nix index 0886e5fedb2c..0ea077a03505 100644 --- a/pkgs/development/python-modules/semver/default.nix +++ b/pkgs/development/python-modules/semver/default.nix @@ -23,11 +23,6 @@ buildPythonPackage rec { hash = "sha256-ry6r2cY/DRTiPxT+ZiumgFbQyHNzL8i1QcQbLWjnDVE="; }; - postPatch = '' - sed -i "/--cov/d" setup.cfg - sed -i "/--no-cov-on-fail/d" setup.cfg - ''; - build-system = [ setuptools setuptools-scm diff --git a/pkgs/development/python-modules/sensor-state-data/default.nix b/pkgs/development/python-modules/sensor-state-data/default.nix index 58d85e20122c..fd414913be3e 100644 --- a/pkgs/development/python-modules/sensor-state-data/default.nix +++ b/pkgs/development/python-modules/sensor-state-data/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, poetry-core, pytestCheckHook, + pytest-cov-stub, pythonOlder, }: @@ -23,12 +24,10 @@ buildPythonPackage rec { nativeBuildInputs = [ poetry-core ]; - nativeCheckInputs = [ pytestCheckHook ]; - - postPatch = '' - substituteInPlace pyproject.toml \ - --replace " --cov=sensor_state_data --cov-report=term-missing:skip-covered" "" - ''; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "sensor_state_data" ]; diff --git a/pkgs/development/python-modules/shtab/default.nix b/pkgs/development/python-modules/shtab/default.nix index f966690fff9b..f89577c49a5a 100644 --- a/pkgs/development/python-modules/shtab/default.nix +++ b/pkgs/development/python-modules/shtab/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, pytest-timeout, pytestCheckHook, + pytest-cov-stub, pythonOlder, setuptools, setuptools-scm, @@ -24,11 +25,6 @@ buildPythonPackage rec { hash = "sha256-8bAwLSdJCzFw5Vf9CKBrH5zOoojeXds7aIRncl+sLBI="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail " --cov=shtab --cov-report=term-missing --cov-report=xml" "" - ''; - nativeBuildInputs = [ setuptools setuptools-scm @@ -38,6 +34,7 @@ buildPythonPackage rec { bashInteractive pytest-timeout pytestCheckHook + pytest-cov-stub ]; pythonImportsCheck = [ "shtab" ]; diff --git a/pkgs/development/python-modules/simple-parsing/default.nix b/pkgs/development/python-modules/simple-parsing/default.nix index 5192030544f2..8943716ef4b6 100644 --- a/pkgs/development/python-modules/simple-parsing/default.nix +++ b/pkgs/development/python-modules/simple-parsing/default.nix @@ -66,6 +66,8 @@ buildPythonPackage rec { pytestCheckHook ]; + pytestFlagsArray = [ "--benchmark-disable" ]; + disabledTests = [ # AssertionError # https://github.com/lebrice/SimpleParsing/issues/338 diff --git a/pkgs/development/python-modules/simple-rest-client/default.nix b/pkgs/development/python-modules/simple-rest-client/default.nix index 023b604c8a57..5607a169bdbb 100644 --- a/pkgs/development/python-modules/simple-rest-client/default.nix +++ b/pkgs/development/python-modules/simple-rest-client/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, httpx, pytest-asyncio, + pytest-cov-stub, pytest-httpserver, pytestCheckHook, python-slugify, @@ -33,6 +34,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio + pytest-cov-stub pytest-httpserver pytestCheckHook ]; @@ -40,8 +42,6 @@ buildPythonPackage rec { postPatch = '' substituteInPlace setup.py \ --replace "pytest-runner" "" - substituteInPlace pytest.ini \ - --replace " --cov=simple_rest_client --cov-report=term-missing" "" substituteInPlace requirements-dev.txt \ --replace "asyncmock" "" ''; diff --git a/pkgs/development/python-modules/sockio/default.nix b/pkgs/development/python-modules/sockio/default.nix index a243425fe3a2..0e0f513c257d 100644 --- a/pkgs/development/python-modules/sockio/default.nix +++ b/pkgs/development/python-modules/sockio/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, }: @@ -23,8 +24,6 @@ buildPythonPackage rec { postPatch = '' substituteInPlace setup.cfg \ - --replace "--cov-config=.coveragerc --cov sockio" "" \ - --replace "--cov-report html --cov-report term" "" \ --replace "--durations=2 --verbose" "" ''; @@ -32,6 +31,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/sure/default.nix b/pkgs/development/python-modules/sure/default.nix index 77b9e2f463c2..8185fdc7676c 100644 --- a/pkgs/development/python-modules/sure/default.nix +++ b/pkgs/development/python-modules/sure/default.nix @@ -4,6 +4,7 @@ fetchPypi, setuptools, pytestCheckHook, + pytest-cov-stub, mock, six, isPyPy, @@ -21,8 +22,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace setup.cfg \ - --replace "rednose = 1" "" \ - --replace-fail "--cov=sure" "" + --replace "rednose = 1" "" ''; build-system = [ setuptools ]; @@ -34,6 +34,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub mock ]; diff --git a/pkgs/development/python-modules/tablib/default.nix b/pkgs/development/python-modules/tablib/default.nix index 1e3f4ead3ffc..fc8d032e4b29 100644 --- a/pkgs/development/python-modules/tablib/default.nix +++ b/pkgs/development/python-modules/tablib/default.nix @@ -7,6 +7,7 @@ openpyxl, pandas, pytestCheckHook, + pytest-cov-stub, pythonOlder, pyyaml, setuptools-scm, @@ -28,11 +29,6 @@ buildPythonPackage rec { hash = "sha256-lNi83GWnFaACSm1bcBpfMeRb0VkmnmLHNzHeefBI2ys="; }; - postPatch = '' - substituteInPlace pytest.ini \ - --replace " --cov=tablib --cov=tests --cov-report xml --cov-report term --cov-report html" "" - ''; - nativeBuildInputs = [ setuptools-scm ]; optional-dependencies = { @@ -61,6 +57,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pandas pytestCheckHook + pytest-cov-stub unicodecsv ]; diff --git a/pkgs/development/python-modules/tailscale/default.nix b/pkgs/development/python-modules/tailscale/default.nix index 725f2171a4f9..a7708fd7579e 100644 --- a/pkgs/development/python-modules/tailscale/default.nix +++ b/pkgs/development/python-modules/tailscale/default.nix @@ -8,6 +8,7 @@ orjson, poetry-core, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, yarl, @@ -30,8 +31,7 @@ buildPythonPackage rec { postPatch = '' # Upstream doesn't set a version for the pyproject.toml substituteInPlace pyproject.toml \ - --replace 'version = "0.0.0"' 'version = "${version}"' \ - --replace "--cov" "" + --replace 'version = "0.0.0"' 'version = "${version}"' ''; nativeBuildInputs = [ poetry-core ]; @@ -46,6 +46,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aresponses pytest-asyncio + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/texsoup/default.nix b/pkgs/development/python-modules/texsoup/default.nix index 14f1c9cfbd2e..d1827c08d38f 100644 --- a/pkgs/development/python-modules/texsoup/default.nix +++ b/pkgs/development/python-modules/texsoup/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, setuptools, pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -22,12 +23,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "TexSoup" ]; - nativeCheckInputs = [ pytestCheckHook ]; - - preCheck = '' - substituteInPlace pytest.ini \ - --replace "--cov=TexSoup" "" - ''; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; meta = with lib; { description = "Fault-tolerant Python3 package for searching, navigating, and modifying LaTeX documents"; diff --git a/pkgs/development/python-modules/tld/default.nix b/pkgs/development/python-modules/tld/default.nix index e6507b54c994..767651e322df 100644 --- a/pkgs/development/python-modules/tld/default.nix +++ b/pkgs/development/python-modules/tld/default.nix @@ -5,6 +5,7 @@ faker, fetchPypi, pytestCheckHook, + pytest-cov-stub, pythonOlder, }: @@ -20,11 +21,10 @@ buildPythonPackage rec { hash = "sha256-k93l4cBL3xhEl26uRAcGN50h9KsjW3PAXXSD4HT7Vik="; }; - postPatch = '' - sed -i "/--cov/d" pytest.ini - ''; - - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; checkInputs = [ factory-boy diff --git a/pkgs/development/python-modules/tomlkit/default.nix b/pkgs/development/python-modules/tomlkit/default.nix index 8c47693a5829..ff676255fc59 100644 --- a/pkgs/development/python-modules/tomlkit/default.nix +++ b/pkgs/development/python-modules/tomlkit/default.nix @@ -13,12 +13,12 @@ buildPythonPackage rec { pname = "tomlkit"; - version = "0.13.2"; + version = "0.13.3"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-//X+WahylbJ4q9Mb7JLBXZvEoGiFqxK86lLHERk5Lnk="; + hash = "sha256-QwzyR+5X3yuU7j++WI5x02KpQeu1Rd7Cm1OWHWGt0qE="; }; build-system = [ poetry-core ]; diff --git a/pkgs/development/python-modules/tsfresh/default.nix b/pkgs/development/python-modules/tsfresh/default.nix index 3b8b7d75c447..50d2d0d9a92c 100644 --- a/pkgs/development/python-modules/tsfresh/default.nix +++ b/pkgs/development/python-modules/tsfresh/default.nix @@ -17,6 +17,7 @@ stumpy, cloudpickle, pytestCheckHook, + pytest-cov-stub, pytest-xdist, mock, matplotlib, @@ -43,7 +44,6 @@ buildPythonPackage rec { patches = [ # The pyscaffold is not a build dependency but just a python project bootstrapping tool, so we do not need it ./remove-pyscaffold.patch - ./remove-pytest-coverage-flags.patch ]; dependencies = [ @@ -63,6 +63,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + pytest-cov-stub pytest-xdist mock matplotlib diff --git a/pkgs/development/python-modules/tsfresh/remove-pytest-coverage-flags.patch b/pkgs/development/python-modules/tsfresh/remove-pytest-coverage-flags.patch deleted file mode 100644 index 86b29606a6e3..000000000000 --- a/pkgs/development/python-modules/tsfresh/remove-pytest-coverage-flags.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/setup.cfg b/setup.cfg -index e29e54e..fe8892f 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -99,10 +99,6 @@ extras = True - # e.g. --cov-report html (or xml) for html/xml output or --junitxml junit.xml - # in order to write a coverage file that can be read by Jenkins. - junit_family = xunit2 --addopts = -- --cov tsfresh --cov-report term-missing -- --verbose -- #-n auto - testpaths = tests - filterwarnings = - diff --git a/pkgs/development/python-modules/unifi-discovery/default.nix b/pkgs/development/python-modules/unifi-discovery/default.nix index 327d75c33ff0..2de32e8aacdb 100644 --- a/pkgs/development/python-modules/unifi-discovery/default.nix +++ b/pkgs/development/python-modules/unifi-discovery/default.nix @@ -7,6 +7,7 @@ poetry-core, pyroute2, pytest-asyncio, + pytest-cov-stub, pytestCheckHook, pythonOlder, }: @@ -25,11 +26,6 @@ buildPythonPackage rec { hash = "sha256-Ea+zxV2GUAaG/BxO103NhOLzzr/TNJaOsynDad2/2VA="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "--cov=unifi_discovery --cov-report=term-missing:skip-covered" "" - ''; - build-system = [ poetry-core ]; dependencies = [ @@ -40,6 +36,7 @@ buildPythonPackage rec { nativeCheckInputs = [ aioresponses pytest-asyncio + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/python-modules/usb-devices/default.nix b/pkgs/development/python-modules/usb-devices/default.nix index fdd4f5b60121..d3a3a7797202 100644 --- a/pkgs/development/python-modules/usb-devices/default.nix +++ b/pkgs/development/python-modules/usb-devices/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, poetry-core, pytestCheckHook, + pytest-cov-stub, pythonOlder, }: @@ -21,14 +22,12 @@ buildPythonPackage rec { hash = "sha256-Nfdl5oRIdOfAo5PFAJJpadRyu2zeEkmYzxDQxbvpt6c="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace " --cov=usb_devices --cov-report=term-missing:skip-covered" "" - ''; - nativeBuildInputs = [ poetry-core ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; pythonImportsCheck = [ "usb_devices" ]; diff --git a/pkgs/development/python-modules/vdirsyncer/default.nix b/pkgs/development/python-modules/vdirsyncer/default.nix index e0a4e1353a57..83e6581f4a2c 100644 --- a/pkgs/development/python-modules/vdirsyncer/default.nix +++ b/pkgs/development/python-modules/vdirsyncer/default.nix @@ -11,6 +11,7 @@ atomicwrites, hypothesis, pytestCheckHook, + pytest-cov-stub, pytest-subtesthack, setuptools, setuptools-scm, @@ -37,10 +38,6 @@ buildPythonPackage rec { hash = "sha256-5DeFH+uYXew1RGVPj5z23RCbCwP34ZlWCGYDCS/+so8="; }; - postPatch = '' - sed -i -e '/--cov/d' -e '/--no-cov/d' pyproject.toml - ''; - nativeBuildInputs = [ setuptools setuptools-scm @@ -64,6 +61,7 @@ buildPythonPackage rec { nativeCheckInputs = [ hypothesis pytestCheckHook + pytest-cov-stub pytest-subtesthack pytest-asyncio trustme diff --git a/pkgs/development/python-modules/warlock/default.nix b/pkgs/development/python-modules/warlock/default.nix index b0352114cf66..6ad45ae49fa7 100644 --- a/pkgs/development/python-modules/warlock/default.nix +++ b/pkgs/development/python-modules/warlock/default.nix @@ -7,6 +7,7 @@ jsonpatch, jsonschema, pytestCheckHook, + pytest-cov-stub, }: buildPythonPackage rec { @@ -23,10 +24,6 @@ buildPythonPackage rec { hash = "sha256-HOCLzFYmOL/tCXT+NO/tCZuVXVowNEPP3g33ZYg4+6Q="; }; - postPatch = '' - sed -i '/--cov/d' pytest.ini - ''; - nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ @@ -34,7 +31,10 @@ buildPythonPackage rec { jsonschema ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; disabledTests = [ # https://github.com/bcwaldon/warlock/issues/64 diff --git a/pkgs/development/python-modules/watchdog/default.nix b/pkgs/development/python-modules/watchdog/default.nix index a577eb617c0b..3dcd610c3eb1 100644 --- a/pkgs/development/python-modules/watchdog/default.nix +++ b/pkgs/development/python-modules/watchdog/default.nix @@ -37,12 +37,6 @@ buildPythonPackage rec { ++ optional-dependencies.watchmedo ++ lib.optionals (pythonOlder "3.13") [ eventlet ]; - postPatch = '' - substituteInPlace setup.cfg \ - --replace "--cov=watchdog" "" \ - --replace "--cov-report=term-missing" "" - ''; - pytestFlagsArray = [ "--deselect=tests/test_emitter.py::test_create_wrong_encoding" diff --git a/pkgs/development/python-modules/wordcloud/default.nix b/pkgs/development/python-modules/wordcloud/default.nix index 4f80b2938578..513e25dae742 100644 --- a/pkgs/development/python-modules/wordcloud/default.nix +++ b/pkgs/development/python-modules/wordcloud/default.nix @@ -7,6 +7,7 @@ numpy, pillow, pytestCheckHook, + pytest-cov-stub, pythonOlder, setuptools, setuptools-scm, @@ -30,11 +31,6 @@ buildPythonPackage rec { hash = "sha256-snPYpd7ZfT6tkEBGtJRk3LcRGe5534dQcqTBBcrdNHo="; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace " --cov --cov-report xml --tb=short" "" - ''; - nativeBuildInputs = [ cython ]; dependencies = [ @@ -43,7 +39,10 @@ buildPythonPackage rec { pillow ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + ]; preCheck = '' cd test diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index dd0fe97d9ff4..5c7ddde8c0c6 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -37,6 +37,36 @@ let #INFO: The targetPrefix prepended to binary names to allow multiple binuntils # on the PATH to both be usable. targetPrefix = lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; + + # gas isn't multi-target, even with --enable-targets=all, so we do + # separate builds of just gas for each target. + # + # There's no way to do this exhaustively, so feel free to add + # additional targets here as required. + allGasTargets = + allGasTargets' + ++ lib.optional (!lib.elem targetPlatform.config allGasTargets') targetPlatform.config; + allGasTargets' = [ + "aarch64-unknown-linux-gnu" + "alpha-unknown-linux-gnu" + "arm-unknown-linux-gnu" + "avr-unknown-linux-gnu" + "cris-unknown-linux-gnu" + "hppa-unknown-linux-gnu" + "i686-unknown-linux-gnu" + "ia64-unknown-linux-gnu" + "m68k-unknown-linux-gnu" + "mips-unknown-linux-gnu" + "mips64-unknown-linux-gnu" + "msp430-unknown-linux-gnu" + "powerpc-unknown-linux-gnu" + "powerpc64-unknown-linux-gnu" + "s390-unknown-linux-gnu" + "sparc-unknown-linux-gnu" + "vax-unknown-linux-gnu" + "x86_64-unknown-linux-gnu" + "xscale-unknown-linux-gnu" + ]; in stdenv.mkDerivation (finalAttrs: { @@ -148,21 +178,11 @@ stdenv.mkDerivation (finalAttrs: { sed -i "$i" -e 's|ln |ln -s |' done - # autoreconfHook is not included for all targets. - # Call it here explicitly as well. - ${finalAttrs.postAutoreconf} + configureScript="$PWD/configure" + mkdir $NIX_BUILD_TOP/build + cd $NIX_BUILD_TOP/build ''; - postAutoreconf = '' - # As we regenerated configure build system tries hard to use - # texinfo to regenerate manuals. Let's avoid the dependency - # on texinfo in bootstrap path and keep manuals unmodified. - touch gas/doc/.dirstamp - touch gas/doc/asconfig.texi - touch gas/doc/as.1 - touch gas/doc/as.info - ''; - # As binutils takes part in the stdenv building, we don't want references # to the bootstrap-tools libgcc (as uses to happen on arm/mips) # @@ -219,7 +239,11 @@ stdenv.mkDerivation (finalAttrs: { # path to force users to declare their use of these libraries. "--with-lib-path=:" ] - ++ lib.optionals withAllTargets [ "--enable-targets=all" ] + ++ lib.optionals withAllTargets [ + "--enable-targets=all" + # gas will be built separately for each target. + "--disable-gas" + ] ++ lib.optionals enableGold [ "--enable-gold${lib.optionalString enableGoldDefault "=default"}" "--enable-plugins" @@ -247,6 +271,30 @@ stdenv.mkDerivation (finalAttrs: { ] ); + postConfigure = lib.optionalString withAllTargets '' + for target in ${lib.escapeShellArgs allGasTargets}; do + mkdir "$NIX_BUILD_TOP/build-$target" + env -C "$NIX_BUILD_TOP/build-$target" \ + "$configureScript" $configureFlags "''${configureFlagsArray[@]}" \ + --enable-gas --program-prefix "$target-" --target "$target" + done + ''; + + makeFlags = [ + # As we regenerated configure build system tries hard to use + # texinfo to regenerate manuals. Let's avoid the dependency + # on texinfo in bootstrap path and keep manuals unmodified. + "MAKEINFO=true" + ]; + + postBuild = lib.optionalString withAllTargets '' + for target in ${lib.escapeShellArgs allGasTargets}; do + make -C "$NIX_BUILD_TOP/build-$target" -j"$NIX_BUILD_CORES" \ + $makeFlags "''${makeFlagsArray[@]}" $buildFlags "''${buildFlagsArray[@]}" \ + TARGET-gas=as-new all-gas + done + ''; + # Fails doCheck = false; @@ -269,10 +317,19 @@ stdenv.mkDerivation (finalAttrs: { # $out/$host/$target/include/* to $dev/include/* # TODO(trofi): fix installation paths upstream so we could remove this # code and have "lib" output unconditionally. - postInstall = lib.optionalString (hostPlatform.config != targetPlatform.config) '' - ln -s $out/${hostPlatform.config}/${targetPlatform.config}/lib/* $out/lib/ - ln -s $out/${hostPlatform.config}/${targetPlatform.config}/include/* $dev/include/ - ''; + postInstall = + lib.optionalString (hostPlatform.config != targetPlatform.config) '' + ln -s $out/${hostPlatform.config}/${targetPlatform.config}/lib/* $out/lib/ + ln -s $out/${hostPlatform.config}/${targetPlatform.config}/include/* $dev/include/ + '' + + lib.optionalString withAllTargets '' + for target in ${lib.escapeShellArgs allGasTargets}; do + make -C "$NIX_BUILD_TOP/build-$target/gas" -j"$NIX_BUILD_CORES" \ + $makeFlags "''${makeFlagsArray[@]}" $installFlags "''${installFlagsArray[@]}" \ + install-exec-bindir + done + ln -s $out/bin/${stdenv.targetPlatform.config}-as $out/bin/as + ''; passthru = { inherit targetPrefix; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libcMinimal.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libcMinimal.nix index 39cd09024fae..36b6f24ad1f4 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libcMinimal.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libcMinimal.nix @@ -6,6 +6,7 @@ byacc, gencat, csu, + i18n, extraSrc ? [ ], }: @@ -32,6 +33,7 @@ mkDerivation { "etc/group" "etc/master.passwd" "etc/shells" + "include/paths.h" ] ++ extraSrc; outputs = [ @@ -54,8 +56,13 @@ mkDerivation { ]; # this target is only used in the rtld-elf derivation. build it there instead. + # + # WE SHOULD REALLY BE REPLACING /usr/lib/i18n WITH THE libiconvModules DERIVATION + # but this causes some awful dependency loops which basically collapse the entire libc derivation + # instead, set the PATH_I18NMODULE environment variable whenever possible postPatch = '' sed -E -i -e '/BUILD_NOSSP_PIC_ARCHIVE=/d' $BSDSRCDIR/lib/libc/Makefile + substituteInPlace $BSDSRCDIR/include/paths.h --replace '/usr/share/i18n' '${i18n}/share/i18n' ''; preBuild = '' diff --git a/pkgs/os-specific/linux/fuse/default.nix b/pkgs/os-specific/linux/fuse/default.nix index cf8992bcb089..bfc3e7988147 100644 --- a/pkgs/os-specific/linux/fuse/default.nix +++ b/pkgs/os-specific/linux/fuse/default.nix @@ -14,7 +14,7 @@ in }; fuse_3 = mkFuse { - version = "3.16.2"; - hash = "sha256-QO9s+IkR0rkqIYNqt2IYST6AVBkCr56jcuuz5nKJuA4="; + version = "3.17.2"; + hash = "sha256-rpWA97ZnoYWEQoUCGtITpx9w1J4qy6LGSxomFNOnKBc="; }; } diff --git a/pkgs/os-specific/linux/fuse/fuse3-Do-not-set-FUSERMOUNT_DIR.patch b/pkgs/os-specific/linux/fuse/fuse3-Do-not-set-FUSERMOUNT_DIR.patch index 582d3eb0dec8..e69991089fa1 100644 --- a/pkgs/os-specific/linux/fuse/fuse3-Do-not-set-FUSERMOUNT_DIR.patch +++ b/pkgs/os-specific/linux/fuse/fuse3-Do-not-set-FUSERMOUNT_DIR.patch @@ -1,13 +1,13 @@ -diff --git a/lib/meson.build b/lib/meson.build --- a/lib/meson.build +++ b/lib/meson.build @@ -37,8 +37,7 @@ libfuse = library('fuse3', libfuse_sources, version: meson.project_version(), - soversion: '3', include_directories: include_dirs, - dependencies: deps, install: true, + include_directories: include_dirs, + dependencies: deps, + install: true, link_depends: 'fuse_versionscript', -- c_args: [ '-DFUSE_USE_VERSION=312', +- c_args: [ '-DFUSE_USE_VERSION=317', - '-DFUSERMOUNT_DIR="@0@"'.format(fusermount_path) ], -+ c_args: [ '-DFUSE_USE_VERSION=312' ], ++ c_args: [ '-DFUSE_USE_VERSION=317' ], link_args: ['-Wl,--version-script,' + meson.current_source_dir() + '/fuse_versionscript' ]) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index d203642bad9b..5d89887378e7 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -836,6 +836,20 @@ stdenv.mkDerivation (finalAttrs: { mv $out/lib/sysusers.d $out/example ''; + doInstallCheck = true; + + # check udev rules exposed by systemd + # can't use `udevCheckHook` here as that would introduce infinite recursion + installCheckPhase = '' + runHook preInstallCheck + + ${lib.optionalString ( + !buildLibsOnly + ) "$out/bin/udevadm verify --resolve-names=never --no-style $out/lib/udev/rules.d"} + + runHook postInstallCheck + ''; + # Avoid *.EFI binary stripping. # At least on aarch64-linux strip removes too much from PE32+ files: # https://github.com/NixOS/nixpkgs/issues/169693 diff --git a/pkgs/servers/minio/default.nix b/pkgs/servers/minio/default.nix index ff933a65c8c7..7f3e4104f7bd 100644 --- a/pkgs/servers/minio/default.nix +++ b/pkgs/servers/minio/default.nix @@ -30,16 +30,16 @@ let in buildGoModule rec { pname = "minio"; - version = "2025-04-22T22-12-26Z"; + version = "2025-05-24T17-08-30Z"; src = fetchFromGitHub { owner = "minio"; repo = "minio"; rev = "RELEASE.${version}"; - hash = "sha256-BC633G27Zuhzk4DCLxtMGyWkQyo/3ObaIod7mDLPAqs="; + hash = "sha256-BB7uEBc0JSJ3nBAy+0i6s4js7Nv/jYw51tbIE6bWjkI="; }; - vendorHash = "sha256-F7texxlSLNVjhlAZPtYYnAd91FIF/BNpq7t1dLaDUpk="; + vendorHash = "sha256-0UoEIlxbAveYlCbGZ2z1q+RAksJrVjdE+ymc6ozDGcE="; doCheck = false; diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index a781c054bfc2..ad5c413764ac 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -1,21 +1,26 @@ # THIS IS A GENERATED FILE. DO NOT EDIT! { lib, + bdftopcf, font-alias, font-util, gccmakedep, + imake, libpciaccess, libpthread-stubs, libxcvt, + lndir, luit, makedepend, pixman, + sessreg, util-macros, xbitmaps, xcb-proto, xkeyboard-config, xorg-cf-files, xorg-docs, + xorgproto, xorg-sgml-doctools, xtrans, }: @@ -23,13 +28,18 @@ self: with self; { inherit + bdftopcf gccmakedep + imake libpciaccess libxcvt + lndir luit makedepend pixman + sessreg xbitmaps + xorgproto xtrans ; fontalias = font-alias; @@ -80,38 +90,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - bdftopcf = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - xorgproto, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "bdftopcf"; - version = "1.1.2"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/util/bdftopcf-1.1.2.tar.xz"; - sha256 = "0fjjn1z0cbsmhxkms93w73j2jbzf9f3xgbnjvnisl3rk0icvwq5w"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ xorgproto ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! bitmap = callPackage ( { @@ -1745,38 +1723,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - imake = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - xorgproto, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "imake"; - version = "1.0.10"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/util/imake-1.0.10.tar.xz"; - sha256 = "1xgcsamfij22ggc4p8anvvihwyf4adg6gjdd6v7m9cypm37cppkm"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ xorgproto ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! libAppleWM = callPackage ( { @@ -3405,38 +3351,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - lndir = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - xorgproto, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "lndir"; - version = "1.0.5"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/util/lndir-1.0.5.tar.xz"; - sha256 = "1nsd23kz6iqxfcis3432zq01i54n98b94m2gcsay1k3mamx5fr9v"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ xorgproto ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! mkfontscale = callPackage ( { @@ -3523,38 +3437,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - sessreg = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - xorgproto, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "sessreg"; - version = "1.1.3"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/app/sessreg-1.1.3.tar.xz"; - sha256 = "1hmc9wsfgl2wmy0kccwa4brxbv02w5wiz5hrz72dsz87x1fwsah2"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ xorgproto ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! setxkbmap = callPackage ( { @@ -7613,82 +7495,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - xorgproto = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - libXt, - python3, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "xorgproto"; - version = "2024.1"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/proto/xorgproto-2024.1.tar.xz"; - sha256 = "0nfbbi4j130m2gxzp20hp642xizbbl68jpbzahiq8nw183yja8ip"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ - pkg-config - python3 - ]; - buildInputs = [ libXt ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ - "applewmproto" - "bigreqsproto" - "compositeproto" - "damageproto" - "dmxproto" - "dpmsproto" - "dri2proto" - "dri3proto" - "evieproto" - "fixesproto" - "fontcacheproto" - "fontsproto" - "glproto" - "inputproto" - "kbproto" - "lg3dproto" - "presentproto" - "printproto" - "randrproto" - "recordproto" - "renderproto" - "resourceproto" - "scrnsaverproto" - "trapproto" - "videoproto" - "windowswmproto" - "xcalibrateproto" - "xcmiscproto" - "xextproto" - "xf86bigfontproto" - "xf86dgaproto" - "xf86driproto" - "xf86miscproto" - "xf86rushproto" - "xf86vidmodeproto" - "xineramaproto" - "xproto" - "xproxymngproto" - "xwaylandproto" - ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! xorgserver = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index 3c524df264b9..025c6e9e253d 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -47,6 +47,15 @@ $pcMap{"\$RENDERPROTO"} = "xorgproto"; $pcMap{"\$DRI3PROTO"} = "xorgproto"; $pcMap{"\$DRI2PROTO"} = "xorgproto"; $pcMap{"\${XKBMODULE}"} = "libxkbfile"; +foreach my $mod ("applewmproto", "bigreqsproto", "compositeproto", "damageproto", "dmxproto", + "dpmsproto", "dri2proto", "dri3proto", "evieproto", "fixesproto", "fontcacheproto", + "fontsproto", "glproto", "inputproto", "kbproto", "lg3dproto", "presentproto", + "printproto", "randrproto", "recordproto", "renderproto", "resourceproto", "scrnsaverproto", + "trapproto", "videoproto", "windowswmproto", "xcalibrateproto", "xcmiscproto", "xextproto", + "xf86bigfontproto", "xf86dgaproto", "xf86driproto", "xf86miscproto", "xf86rushproto", + "xf86vidmodeproto", "xineramaproto", "xproto", "xproxymngproto", "xwaylandproto") { + $pcMap{$mod} = "xorgproto"; +} my $downloadCache = "./download-cache"; @@ -266,21 +275,26 @@ print OUT <' '' \ - --replace '' '' \ - --replace '_X_ATTRIBUTE_PRINTF(1,2)' '__attribute__((__format__(__printf__,1,2)))' \ - --replace '_X_ATTRIBUTE_PRINTF(2,3)' '__attribute__((__format__(__printf__,2,3)))' \ - --replace '_X_NORETURN' '__attribute__((noreturn))' \ - --replace 'n_dirs--;' "" - ''; - meta = attrs.meta // { - mainProgram = "lndir"; - }; - }); - twm = super.twm.overrideAttrs (attrs: { nativeBuildInputs = attrs.nativeBuildInputs ++ [ bison @@ -1424,13 +1354,6 @@ self: super: }; }); - sessreg = super.sessreg.overrideAttrs (attrs: { - preBuild = "sed -i 's|gcc -E|gcc -E -P|' man/Makefile"; - meta = attrs.meta // { - mainProgram = "sessreg"; - }; - }); - xrandr = super.xrandr.overrideAttrs (attrs: { postInstall = '' rm $out/bin/xkeystone diff --git a/pkgs/servers/x11/xorg/tarballs.list b/pkgs/servers/x11/xorg/tarballs.list index 14abf4d903ae..afbf7c57568b 100644 --- a/pkgs/servers/x11/xorg/tarballs.list +++ b/pkgs/servers/x11/xorg/tarballs.list @@ -13,7 +13,6 @@ mirror://xorg/individual/app/ico-1.0.6.tar.xz mirror://xorg/individual/app/listres-1.0.6.tar.xz mirror://xorg/individual/app/mkfontscale-1.2.3.tar.xz mirror://xorg/individual/app/oclock-1.0.5.tar.xz -mirror://xorg/individual/app/sessreg-1.1.3.tar.xz mirror://xorg/individual/app/setxkbmap-1.3.4.tar.xz mirror://xorg/individual/app/smproxy-1.0.7.tar.xz mirror://xorg/individual/app/transset-1.0.3.tar.xz @@ -198,8 +197,4 @@ mirror://xorg/individual/lib/libXxf86dga-1.1.6.tar.xz mirror://xorg/individual/lib/libXxf86misc-1.0.4.tar.bz2 mirror://xorg/individual/lib/libXxf86vm-1.1.6.tar.xz mirror://xorg/individual/lib/xcb-util-cursor-0.1.5.tar.xz -mirror://xorg/individual/proto/xorgproto-2024.1.tar.xz -mirror://xorg/individual/util/bdftopcf-1.1.2.tar.xz -mirror://xorg/individual/util/imake-1.0.10.tar.xz -mirror://xorg/individual/util/lndir-1.0.5.tar.xz mirror://xorg/individual/xserver/xorg-server-21.1.16.tar.xz diff --git a/pkgs/stdenv/freebsd/default.nix b/pkgs/stdenv/freebsd/default.nix index f2cb2e5e0b29..b52c8ea37244 100644 --- a/pkgs/stdenv/freebsd/default.nix +++ b/pkgs/stdenv/freebsd/default.nix @@ -62,6 +62,9 @@ let name = attrs.name or (builtins.baseNameOf (builtins.elemAt attrs.paths 0)); src = bootstrapArchive; builder = "${bootstrapArchive}/bin/bash"; + # this script will prefer to link files instead of copying them. + # this prevents clang in particular, but possibly others, from calling readlink(argv[0]) + # and obtaining dependencies, ld(1) in particular, from there instead of $PATH. args = [ ./linkBootstrap.sh ]; PATH = "${bootstrapArchive}/bin"; paths = attrs.paths; @@ -93,6 +96,7 @@ let "bin/clang" "bin/clang++" "bin/cpp" + "lib/clang" ]; # SYNCME: this version number must be synced with the one in make-bootstrap-tools.nix version = "18"; @@ -443,18 +447,22 @@ let inherit (prevStage.freebsd) libc; inherit (prevStage) gnugrep coreutils expand-response-params; runtimeShell = shell; - bintools = prevStage.binutils-unwrapped; + bintools = (prevStage.llvmPackages or { }).bintools-unwrapped or prevStage.binutils-unwrapped; propagateDoc = false; nativeTools = false; nativeLibc = false; }; }; overrides = overrides prevStage; - preHook = '' - export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" - export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" - export PATH_LOCALE=${prevStage.freebsd.localesReal or prevStage.freebsd.locales}/share/locale - ''; + preHook = + '' + export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" + export PATH_LOCALE=${prevStage.freebsd.localesReal or prevStage.freebsd.locales}/share/locale + '' + + lib.optionalString (prevStage.freebsd ? libiconvModules) '' + export PATH_I18NMODULE=${prevStage.freebsd.libiconvModules}/lib/i18n + ''; }; in { diff --git a/pkgs/stdenv/freebsd/linkBootstrap.sh b/pkgs/stdenv/freebsd/linkBootstrap.sh index 19b491d2c3c4..73f984d1f1f0 100644 --- a/pkgs/stdenv/freebsd/linkBootstrap.sh +++ b/pkgs/stdenv/freebsd/linkBootstrap.sh @@ -6,5 +6,9 @@ for path in $paths; do exit 1 fi mkdir -p $out/$(dirname $path) - ln -s $src/$path $out/$path + if [[ -d $src/$path ]]; then + ln -s $src/$path $out/$path + else + cp -RL $src/$path $out/$path + fi done diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 4d9bb81fbbce..a8aba74321b0 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -78,6 +78,7 @@ let ../../build-support/setup-hooks/move-sbin.sh ../../build-support/setup-hooks/move-systemd-user-units.sh ../../build-support/setup-hooks/multiple-outputs.sh + ../../build-support/setup-hooks/parallel.sh ../../build-support/setup-hooks/patch-shebangs.sh ../../build-support/setup-hooks/prune-libtool-files.sh ../../build-support/setup-hooks/reproducible-builds.sh diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 344906eb34fa..4be15d11356d 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1260,7 +1260,7 @@ _defaultUnpack() { # We can't preserve hardlinks because they may have been # introduced by store optimization, which might break things # in the build. - cp -r --preserve=mode,timestamps --reflink=auto -- "$fn" "$destination" + cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination" else diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix index 7804ea23b06e..b36a82e44a7a 100644 --- a/pkgs/test/default.nix +++ b/pkgs/test/default.nix @@ -212,4 +212,6 @@ with pkgs; build-environment-info = callPackage ./build-environment-info { }; rust-hooks = recurseIntoAttrs (callPackages ../build-support/rust/hooks/test { }); + + setup-hooks = recurseIntoAttrs (callPackages ../build-support/setup-hooks/tests { }); } diff --git a/pkgs/tools/inputmethods/ibus/default.nix b/pkgs/tools/inputmethods/ibus/default.nix index f951be91af29..6c47a6b6e441 100644 --- a/pkgs/tools/inputmethods/ibus/default.nix +++ b/pkgs/tools/inputmethods/ibus/default.nix @@ -27,8 +27,8 @@ python3, json-glib, libnotify ? null, - enableUI ? true, - withWayland ? true, + enableUI ? !libOnly, + withWayland ? !libOnly, libxkbcommon, wayland, wayland-protocols, @@ -36,6 +36,10 @@ buildPackages, runtimeShell, nixosTests, + versionCheckHook, + nix-update-script, + libX11, + libOnly ? false, }: let @@ -61,14 +65,14 @@ let ''; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ibus"; version = "1.5.32"; src = fetchFromGitHub { owner = "ibus"; repo = "ibus"; - tag = version; + tag = finalAttrs.version; hash = "sha256-Rp2Aw2C2LXMBp8++pnZtPHiPoFDERpkDsKd0E//twuY="; }; @@ -86,11 +90,14 @@ stdenv.mkDerivation rec { ./build-without-dbus-launch.patch ]; - outputs = [ - "out" - "dev" - "installedTests" - ]; + outputs = + [ + "out" + "dev" + ] + ++ lib.optionals (!libOnly) [ + "installedTests" + ]; postPatch = '' # Maintainer does not want to create separate tarballs for final release candidate and release versions, @@ -107,29 +114,38 @@ stdenv.mkDerivation rec { preAutoreconf = "touch ChangeLog"; - configureFlags = [ - # The `AX_PROG_{CC,CXX}_FOR_BUILD` autoconf macros can pick up unwrapped GCC binaries, - # so we set `{CC,CXX}_FOR_BUILD` to override that behavior. - # https://github.com/NixOS/nixpkgs/issues/21751 - "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" - "CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++" - "GLIB_COMPILE_RESOURCES=${lib.getDev buildPackages.glib}/bin/glib-compile-resources" - "PKG_CONFIG_VAPIGEN_VAPIGEN=${lib.getBin buildPackages.vala}/bin/vapigen" - "--disable-memconf" - (lib.enableFeature (dconf != null) "dconf") - (lib.enableFeature (libnotify != null) "libnotify") - (lib.enableFeature withWayland "wayland") - (lib.enableFeature enableUI "ui") - "--disable-gtk2" - "--enable-gtk4" - "--enable-install-tests" - "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" - "--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations" - "--with-python=${python3BuildEnv.interpreter}" - "--with-ucd-dir=${unicode-character-database}/share/unicode" - ]; + configureFlags = + [ + # The `AX_PROG_{CC,CXX}_FOR_BUILD` autoconf macros can pick up unwrapped GCC binaries, + # so we set `{CC,CXX}_FOR_BUILD` to override that behavior. + # https://github.com/NixOS/nixpkgs/issues/21751 + "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" + "CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++" + "GLIB_COMPILE_RESOURCES=${lib.getDev buildPackages.glib}/bin/glib-compile-resources" + "PKG_CONFIG_VAPIGEN_VAPIGEN=${lib.getBin buildPackages.vala}/bin/vapigen" + "--disable-memconf" + "--disable-gtk2" + "--with-python=${python3BuildEnv.interpreter}" + (lib.enableFeature (!libOnly && dconf != null) "dconf") + (lib.enableFeature (!libOnly && libnotify != null) "libnotify") + (lib.enableFeature withWayland "wayland") + (lib.enableFeature enableUI "ui") + (lib.enableFeature (!libOnly) "gtk3") + (lib.enableFeature (!libOnly) "gtk4") + (lib.enableFeature (!libOnly) "xim") + (lib.enableFeature (!libOnly) "appindicator") + (lib.enableFeature (!libOnly) "tests") + (lib.enableFeature (!libOnly) "install-tests") + (lib.enableFeature (!libOnly) "emoji-dict") + (lib.enableFeature (!libOnly) "unicode-dict") + ] + ++ lib.optionals (!libOnly) [ + "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" + "--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations" + "--with-ucd-dir=${unicode-character-database}/share/unicode" + ]; - makeFlags = [ + makeFlags = lib.optionals (!libOnly) [ "test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus" "test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus" ]; @@ -146,11 +162,14 @@ stdenv.mkDerivation rec { makeWrapper pkg-config python3BuildEnv - vala - wrapGAppsHook3 dbus-launch + glib # required to satisfy AM_PATH_GLIB_2_0 + vala gobject-introspection ] + ++ lib.optionals (!libOnly) [ + wrapGAppsHook3 + ] ++ lib.optionals withWayland [ wayland-scanner ]; @@ -164,14 +183,17 @@ stdenv.mkDerivation rec { dbus systemd dconf - gdk-pixbuf python3.pkgs.pygobject3 # for pygobject overrides - gtk3 - gtk4 isocodes json-glib - libnotify + libX11 + ] + ++ lib.optionals (!libOnly) [ + gtk3 + gtk4 + gdk-pixbuf libdbusmenu-gtk3 + libnotify vala # for share/vala/Makefile.vapigen (PKG_CONFIG_VAPIGEN_VAPIGEN) ] ++ lib.optionals withWayland [ @@ -181,20 +203,22 @@ stdenv.mkDerivation rec { ]; enableParallelBuilding = true; + strictDeps = true; doCheck = false; # requires X11 daemon - doInstallCheck = true; - installCheckPhase = '' - $out/bin/ibus version - ''; - postInstall = '' + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "version"; + versionCheckProgram = "${placeholder "out"}/bin/ibus"; + + postInstall = lib.optionalString (!libOnly) '' # It has some hardcoded FHS paths and also we do not use it # since we set up the environment in NixOS tests anyway. moveToOutput "bin/ibus-desktop-testing-runner" "$installedTests" ''; - postFixup = '' + postFixup = lib.optionalString (!libOnly) '' # set necessary environment also for tests for f in $installedTests/libexec/installed-tests/ibus/*; do wrapGApp $f @@ -202,16 +226,18 @@ stdenv.mkDerivation rec { ''; passthru = { - tests = { + tests = lib.optionalAttrs (!libOnly) { installed-tests = nixosTests.installed-tests.ibus; }; + updateScript = nix-update-script { }; }; - meta = with lib; { + meta = { + changelog = "https://github.com/ibus/ibus/releases/tag/${finalAttrs.src.tag}"; homepage = "https://github.com/ibus/ibus"; description = "Intelligent Input Bus, input method framework"; - license = licenses.lgpl21Plus; - platforms = platforms.linux; - maintainers = with maintainers; [ ttuegel ]; + license = lib.licenses.lgpl21Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ ttuegel ]; }; -} +}) diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix index c9f0f0f859bf..1c79da3c65e3 100644 --- a/pkgs/tools/misc/file/default.nix +++ b/pkgs/tools/misc/file/default.nix @@ -38,8 +38,9 @@ stdenv.mkDerivation (finalAttrs: { # It is included in 5.46+, but we are not updating to it or a later version until: # # https://bugs.astron.com/view.php?id=622 + # https://bugs.astron.com/view.php?id=638 # - # is resolved. See also description of the bug here: + # are resolved. See also description of the 1st bug here: # # https://github.com/NixOS/nixpkgs/pull/402318#issuecomment-2881163359 ./32-bit-time_t.patch diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix index 2d2d34b698b5..3f7429eb749b 100644 --- a/pkgs/tools/text/diffutils/default.nix +++ b/pkgs/tools/text/diffutils/default.nix @@ -44,6 +44,10 @@ stdenv.mkDerivation rec { sed -i -E 's:[[:space:]]test-sigsegv-catch-stackoverflow[12]\$\(EXEEXT\)::g' gnulib-tests/Makefile.in sed -i -E 's:[[:space:]]test-sigaction\$\(EXEEXT\)::g' gnulib-tests/Makefile.in '' + else if stdenv.hostPlatform.isFreeBSD then + '' + sed -i -E 's:test-time::g' gnulib-tests/Makefile.in + '' else null; diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix index 7d6d5b82e7a6..e370b1cb11f8 100644 --- a/pkgs/tools/text/gnupatch/default.nix +++ b/pkgs/tools/text/gnupatch/default.nix @@ -3,6 +3,7 @@ stdenv, fetchurl, ed, + autoreconfHook, }: stdenv.mkDerivation rec { @@ -14,6 +15,13 @@ stdenv.mkDerivation rec { hash = "sha256-+Hzuae7CtPy/YKOWsDCtaqNBXxkqpffuhMrV4R9/WuM="; }; + # This test is filesystem-dependent - observed failing on ZFS + postPatch = lib.optionalString stdenv.hostPlatform.isFreeBSD '' + sed -E -i -e '/bad-filenames/d' tests/Makefile.am + ''; + + nativeBuildInputs = [ autoreconfHook ]; + configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_strnlen_working=yes" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 90aab353e74e..26c9993cb086 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -243,6 +243,9 @@ with pkgs; auto-patchelf bintools ]; + substitutions = { + hostPlatform = stdenv.hostPlatform.config; + }; } ../build-support/setup-hooks/auto-patchelf.sh; appimageTools = callPackage ../build-support/appimage { }; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 9ede09b000c5..36daeec411aa 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -17725,13 +17725,17 @@ with self; }; }; - IOTty = buildPerlPackage { + IOTty = buildPerlPackage rec { pname = "IO-Tty"; version = "1.20"; src = fetchurl { - url = "mirror://cpan/authors/id/T/TO/TODDR/IO-Tty-1.20.tar.gz"; + url = "mirror://cpan/authors/id/T/TO/TODDR/IO-Tty-${version}.tar.gz"; hash = "sha256-sVMJ/IViOJMonLmyuI36ntHmkVa3XymThVOkW+bXMK8="; }; + # Fix dynamic loading not available when cross compiling + postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + sed -i '/use IO::File/d' Makefile.PL + ''; doCheck = !stdenv.hostPlatform.isDarwin; # openpty fails in the sandbox meta = { homepage = "https://github.com/toddr/IO-Tty";