diff --git a/.github/labeler.yml b/.github/labeler.yml index a6e8d734382e..ebf47d6f9528 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -122,6 +122,7 @@ - any: - changed-files: - any-glob-to-any-file: + - pkgs/development/tools/misc/luarocks/* - pkgs/development/interpreters/lua-5/**/* - pkgs/development/interpreters/luajit/**/* - pkgs/development/lua-modules/**/* diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md index a6577a56a436..87cd0c4c90d7 100644 --- a/doc/languages-frameworks/lua.section.md +++ b/doc/languages-frameworks/lua.section.md @@ -17,6 +17,9 @@ The main package set contains aliases to these package sets, e.g. `luaPackages` refers to `lua5_1.pkgs` and `lua52Packages` to `lua5_2.pkgs`. +Note that nixpkgs patches the non-luajit interpreters to avoid referring to +`/usr` and have `;;` (a [placeholder](https://www.lua.org/manual/5.1/manual.html#pdf-package.path) replaced with the default LUA_PATH) work correctly. + ### Installing Lua and packages {#installing-lua-and-packages} #### Lua environment defined in separate `.nix` file {#lua-environment-defined-in-separate-.nix-file} diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 19ff6f4485cd..65cbf483ac6e 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -58,6 +58,9 @@ In addition to numerous new and upgraded packages, this release has the followin } ``` +- lua interpreters default LUA_PATH and LUA_CPATH are not overriden by nixpkgs + anymore, we patch LUA_ROOT instead which is more respectful to upstream. + - Plasma 6 is now available and can be installed with `services.xserver.desktopManager.plasma6.enable = true;`. Plasma 5 will likely be deprecated in the next release (24.11). Note that Plasma 6 runs as Wayland by default, and the X11 session needs to be explicitly selected if necessary. ## New Services {#sec-release-24.05-new-services} diff --git a/pkgs/applications/editors/vim/plugins/neovim-require-check-hook.sh b/pkgs/applications/editors/vim/plugins/neovim-require-check-hook.sh index 5b454e0ff01b..0c6a0010845d 100644 --- a/pkgs/applications/editors/vim/plugins/neovim-require-check-hook.sh +++ b/pkgs/applications/editors/vim/plugins/neovim-require-check-hook.sh @@ -10,7 +10,7 @@ neovimRequireCheckHook () { # editorconfig-checker-disable export HOME="$TMPDIR" @nvimBinary@ -es --headless -n -u NONE -i NONE --clean -V1 \ - --cmd "set rtp+=$out" \ + --cmd "set rtp+=$out,${dependencies/ /,}" \ --cmd "lua require('$nvimRequireCheck')" fi } diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index b50f1c8f81e4..590865359391 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -670,6 +670,9 @@ hardhat-nvim = super.hardhat-nvim.overrideAttrs { dependencies = with self; [ overseer-nvim plenary-nvim ]; + + doInstallCheck = true; + nvimRequireCheck = "hardhat"; }; harpoon = super.harpoon.overrideAttrs { diff --git a/pkgs/applications/emulators/dolphin-emu/default.nix b/pkgs/applications/emulators/dolphin-emu/default.nix index f81fce6a5aa8..b2a9bbb7bbc4 100644 --- a/pkgs/applications/emulators/dolphin-emu/default.nix +++ b/pkgs/applications/emulators/dolphin-emu/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , cmake , pkg-config , wrapQtAppsHook @@ -71,6 +72,12 @@ stdenv.mkDerivation rec { patches = [ # Remove when merged https://github.com/dolphin-emu/dolphin/pull/12070 ./find-minizip-ng.patch + + # fix buidl w/ glibc-2.39 + (fetchpatch { + url = "https://github.com/dolphin-emu/dolphin/commit/3da2e15e6b95f02f66df461e87c8b896e450fdab.patch"; + hash = "sha256-+8yGF412wQUYbyEuYWd41pgOgEbhCaezexxcI5CNehc="; + }) ]; strictDeps = true; diff --git a/pkgs/build-support/agda/default.nix b/pkgs/build-support/agda/default.nix index 893383a759ae..d8f55226ed13 100644 --- a/pkgs/build-support/agda/default.nix +++ b/pkgs/build-support/agda/default.nix @@ -2,14 +2,28 @@ { stdenv, lib, self, Agda, runCommand, makeWrapper, writeText, ghcWithPackages, nixosTests }: -with lib.strings; - let + inherit (lib) + attrValues + elem + filter + filterAttrs + isAttrs + isList + platforms + ; + + inherit (lib.strings) + concatMapStrings + concatMapStringsSep + optionalString + ; + withPackages' = { pkgs, ghc ? ghcWithPackages (p: with p; [ ieee754 ]) }: let - pkgs' = if builtins.isList pkgs then pkgs else pkgs self; + pkgs' = if isList pkgs then pkgs else pkgs self; library-file = writeText "libraries" '' ${(concatMapStringsSep "\n" (p: "${p}/${p.libraryFile}") pkgs')} ''; @@ -23,7 +37,7 @@ let inherit withPackages; tests = { inherit (nixosTests) agda; - allPackages = withPackages (lib.filter self.lib.isUnbrokenAgdaPackage (lib.attrValues self)); + allPackages = withPackages (filter self.lib.isUnbrokenAgdaPackage (attrValues self)); }; }; inherit (Agda) meta; @@ -36,7 +50,7 @@ let ln -s ${Agda}/bin/agda-mode $out/bin/agda-mode ''; # Local interfaces has been added for now: See https://github.com/agda/agda/issues/4526 - withPackages = arg: if builtins.isAttrs arg then withPackages' arg else withPackages' { pkgs = arg; }; + withPackages = arg: if isAttrs arg then withPackages' arg else withPackages' { pkgs = arg; }; extensions = [ "agda" @@ -63,7 +77,7 @@ let , extraExtensions ? [] , ... }: let - agdaWithArgs = withPackages (builtins.filter (p: p ? isAgdaDerivation) buildInputs); + agdaWithArgs = withPackages (filter (p: p ? isAgdaDerivation) buildInputs); includePathArgs = concatMapStrings (path: "-i" + path + " ") (includePaths ++ [(dirOf everythingFile)]); in { @@ -91,13 +105,13 @@ let # darwin, it seems that there is no standard such locale; luckily, # the referenced issue doesn't seem to surface on darwin. Hence let's # set this only on non-darwin. - LC_ALL = lib.optionalString (!stdenv.isDarwin) "C.UTF-8"; + LC_ALL = optionalString (!stdenv.isDarwin) "C.UTF-8"; - meta = if meta.broken or false then meta // { hydraPlatforms = lib.platforms.none; } else meta; + meta = if meta.broken or false then meta // { hydraPlatforms = platforms.none; } else meta; # Retrieve all packages from the finished package set that have the current package as a dependency and build them - passthru.tests = with builtins; - lib.filterAttrs (name: pkg: self.lib.isUnbrokenAgdaPackage pkg && elem pname (map (pkg: pkg.pname) pkg.buildInputs)) self; + passthru.tests = + filterAttrs (name: pkg: self.lib.isUnbrokenAgdaPackage pkg && elem pname (map (pkg: pkg.pname) pkg.buildInputs)) self; }; in { diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 1a32f365bab2..b2545d0ad0e5 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -35,7 +35,7 @@ # Note: the hardening flags are part of the bintools-wrapper, rather than # the cc-wrapper, because a few of them are handled by the linker. -, defaultHardeningFlags ? with stdenvNoCC; [ +, defaultHardeningFlags ? [ "bindnow" "format" "fortify" @@ -44,7 +44,7 @@ "relro" "stackprotector" "strictoverflow" - ] ++ lib.optional ( + ] ++ lib.optional (with stdenvNoCC; # Musl-based platforms will keep "pie", other platforms will not. # If you change this, make sure to update section `{#sec-hardening-in-nixpkgs}` # in the nixpkgs manual to inform users about the defaults. @@ -59,15 +59,30 @@ , postLinkSignHook ? null, signingUtils ? null }: -with lib; - assert nativeTools -> !propagateDoc && nativePrefix != ""; -assert !nativeTools -> - bintools != null && coreutils != null && gnugrep != null; +assert !nativeTools -> bintools != null && coreutils != null && gnugrep != null; assert !(nativeLibc && noLibc); assert (noLibc || nativeLibc) == (libc == null); let + inherit (lib) + attrByPath + concatStringsSep + getBin + getDev + getLib + getName + getVersion + hasSuffix + optional + optionalAttrs + optionals + optionalString + platforms + removePrefix + replaceStrings + ; + stdenv = stdenvNoCC; inherit (stdenv) hostPlatform targetPlatform; @@ -75,18 +90,18 @@ let # # TODO(@Ericson2314) Make unconditional, or optional but always true by # default. - targetPrefix = lib.optionalString (targetPlatform != hostPlatform) + targetPrefix = optionalString (targetPlatform != hostPlatform) (targetPlatform.config + "-"); - bintoolsVersion = lib.getVersion bintools; - bintoolsName = lib.removePrefix targetPrefix (lib.getName bintools); + bintoolsVersion = getVersion bintools; + bintoolsName = removePrefix targetPrefix (getName bintools); - libc_bin = lib.optionalString (libc != null) (getBin libc); - libc_dev = lib.optionalString (libc != null) (getDev libc); - libc_lib = lib.optionalString (libc != null) (getLib libc); - bintools_bin = lib.optionalString (!nativeTools) (getBin bintools); + libc_bin = optionalString (libc != null) (getBin libc); + libc_dev = optionalString (libc != null) (getDev libc); + libc_lib = optionalString (libc != null) (getLib libc); + bintools_bin = optionalString (!nativeTools) (getBin bintools); # The wrapper scripts use 'cat' and 'grep', so we may need coreutils. - coreutils_bin = lib.optionalString (!nativeTools) (getBin coreutils); + coreutils_bin = optionalString (!nativeTools) (getBin coreutils); # See description in cc-wrapper. suffixSalt = replaceStrings ["-" "."] ["_" "_"] targetPlatform.config; @@ -114,11 +129,11 @@ let else if targetPlatform.isLoongArch64 then "${sharedLibraryLoader}/lib/ld-linux-loongarch*.so.1" else if targetPlatform.isDarwin then "/usr/lib/dyld" else if targetPlatform.isFreeBSD then "/libexec/ld-elf.so.1" - else if lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1" + else if hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1" else ""; expand-response-params = - lib.optionalString (buildPackages ? stdenv && buildPackages.stdenv.hasCC && buildPackages.stdenv.cc != "/dev/null") + optionalString (buildPackages ? stdenv && buildPackages.stdenv.hasCC && buildPackages.stdenv.cc != "/dev/null") (import ../expand-response-params { inherit (buildPackages) stdenv; }); in @@ -126,7 +141,7 @@ in stdenv.mkDerivation { pname = targetPrefix + (if name != "" then name else "${bintoolsName}-wrapper"); - version = lib.optionalString (bintools != null) bintoolsVersion; + version = optionalString (bintools != null) bintoolsVersion; preferLocalBuild = true; @@ -196,7 +211,7 @@ stdenv.mkDerivation { # as it must have both the GNU assembler from cctools (installed as `gas`) # and the Clang integrated assembler (installed as `as`). # See pkgs/os-specific/darwin/binutils/default.nix for details. - + lib.optionalString wrapGas '' + + optionalString wrapGas '' if [ -e $ldPath/${targetPrefix}gas ]; then ln -s $ldPath/${targetPrefix}gas $out/bin/${targetPrefix}gas fi @@ -273,7 +288,7 @@ stdenv.mkDerivation { ${if targetPlatform.isDarwin then '' printf "export LD_DYLD_PATH=%q\n" "$dynamicLinker" >> $out/nix-support/setup-hook - '' else lib.optionalString (sharedLibraryLoader != null) '' + '' else optionalString (sharedLibraryLoader != null) '' if [ -e ${sharedLibraryLoader}/lib/32/ld-linux.so.2 ]; then echo ${sharedLibraryLoader}/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 fi @@ -290,7 +305,7 @@ stdenv.mkDerivation { # install the wrapper, you get tools like objdump (same for any # binaries of libc). + optionalString (!nativeTools) '' - printWords ${bintools_bin} ${lib.optionalString (libc != null) libc_bin} > $out/nix-support/propagated-user-env-packages + printWords ${bintools_bin} ${optionalString (libc != null) libc_bin} > $out/nix-support/propagated-user-env-packages '' ## @@ -406,7 +421,7 @@ stdenv.mkDerivation { # for substitution in utils.bash expandResponseParams = "${expand-response-params}/bin/expand-response-params"; shell = getBin shell + shell.shellPath or ""; - gnugrep_bin = lib.optionalString (!nativeTools) gnugrep; + gnugrep_bin = optionalString (!nativeTools) gnugrep; wrapperName = "BINTOOLS_WRAPPER"; inherit dynamicLinker targetPrefix suffixSalt coreutils_bin; inherit bintools_bin libc_bin libc_dev libc_lib; @@ -414,13 +429,13 @@ stdenv.mkDerivation { }; meta = - let bintools_ = lib.optionalAttrs (bintools != null) bintools; in - (lib.optionalAttrs (bintools_ ? meta) (removeAttrs bintools.meta ["priority"])) // + let bintools_ = optionalAttrs (bintools != null) bintools; in + (optionalAttrs (bintools_ ? meta) (removeAttrs bintools.meta ["priority"])) // { description = - lib.attrByPath ["meta" "description"] "System binary utilities" bintools_ + attrByPath ["meta" "description"] "System binary utilities" bintools_ + " (wrapper script)"; priority = 10; } // optionalAttrs useMacosReexportHack { - platforms = lib.platforms.darwin; + platforms = platforms.darwin; }; } diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix index 3292f4039a63..56dce551870e 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix @@ -31,10 +31,20 @@ assert (pname != null || version != null) -> (name == null && pname != null); # You must declare either a name or pname + version (preferred). -with builtins; let + inherit (lib) + concatLines + concatStringsSep + escapeShellArgs + filter + optionalString + splitString + ; + + inherit (lib.attrsets) removeAttrs; + pname = if args ? name && args.name != null then args.name else args.pname; - versionStr = lib.optionalString (version != null) ("-" + version); + versionStr = optionalString (version != null) ("-" + version); name = pname + versionStr; buildFHSEnv = callPackage ./buildFHSEnv.nix { }; @@ -116,10 +126,10 @@ let exec ${run} "$@" ''; - indentLines = str: lib.concatLines (map (s: " " + s) (filter (s: s != "") (lib.splitString "\n" str))); + indentLines = str: concatLines (map (s: " " + s) (filter (s: s != "") (splitString "\n" str))); bwrapCmd = { initArgs ? "" }: '' ${extraPreBwrapCmds} - ignored=(/nix /dev /proc /etc ${lib.optionalString privateTmp "/tmp"}) + ignored=(/nix /dev /proc /etc ${optionalString privateTmp "/tmp"}) ro_mounts=() symlinks=() etc_ignored=() @@ -156,7 +166,7 @@ let ro_mounts+=(--ro-bind /etc /.host-etc) fi - for i in ${lib.escapeShellArgs etcBindEntries}; do + for i in ${escapeShellArgs etcBindEntries}; do if [[ "''${etc_ignored[@]}" =~ "$i" ]]; then continue fi @@ -187,7 +197,7 @@ let x11_args+=(--ro-bind-try "$local_socket" "$local_socket") fi - ${lib.optionalString privateTmp '' + ${optionalString privateTmp '' # sddm places XAUTHORITY in /tmp if [[ "$XAUTHORITY" == /tmp/* ]]; then x11_args+=(--ro-bind-try "$XAUTHORITY" "$XAUTHORITY") @@ -212,15 +222,15 @@ let --dev-bind /dev /dev --proc /proc --chdir "$(pwd)" - ${lib.optionalString unshareUser "--unshare-user"} - ${lib.optionalString unshareIpc "--unshare-ipc"} - ${lib.optionalString unsharePid "--unshare-pid"} - ${lib.optionalString unshareNet "--unshare-net"} - ${lib.optionalString unshareUts "--unshare-uts"} - ${lib.optionalString unshareCgroup "--unshare-cgroup"} - ${lib.optionalString dieWithParent "--die-with-parent"} + ${optionalString unshareUser "--unshare-user"} + ${optionalString unshareIpc "--unshare-ipc"} + ${optionalString unsharePid "--unshare-pid"} + ${optionalString unshareNet "--unshare-net"} + ${optionalString unshareUts "--unshare-uts"} + ${optionalString unshareCgroup "--unshare-cgroup"} + ${optionalString dieWithParent "--die-with-parent"} --ro-bind /nix /nix - ${lib.optionalString privateTmp "--tmpfs /tmp"} + ${optionalString privateTmp "--tmpfs /tmp"} # Our glibc will look for the cache in its own path in `/nix/store`. # As such, we need a cache to exist there, because pressure-vessel # depends on the existence of an ld cache. However, adding one @@ -234,7 +244,7 @@ let --symlink /etc/ld.so.cache ${glibc}/etc/ld.so.cache \ --ro-bind ${glibc}/etc/rpc ${glibc}/etc/rpc \ --remount-ro ${glibc}/etc \ - '' + lib.optionalString (stdenv.isx86_64 && stdenv.isLinux) (indentLines '' + '' + optionalString (stdenv.isx86_64 && stdenv.isLinux) (indentLines '' --tmpfs ${pkgsi686Linux.glibc}/etc \ --symlink /etc/ld.so.conf ${pkgsi686Linux.glibc}/etc/ld.so.conf \ --symlink /etc/ld.so.cache ${pkgsi686Linux.glibc}/etc/ld.so.cache \ diff --git a/pkgs/build-support/coq/default.nix b/pkgs/build-support/coq/default.nix index eb045ddf6865..6036d0f05dd5 100644 --- a/pkgs/build-support/coq/default.nix +++ b/pkgs/build-support/coq/default.nix @@ -1,10 +1,33 @@ { lib, stdenv, coqPackages, coq, which, fetchzip }@args: -let lib = import ./extra-lib.nix {inherit (args) lib;}; in -with builtins; with lib; + let + lib = import ./extra-lib.nix { + inherit (args) lib; + }; + + inherit (lib) + concatStringsSep + flip + foldl + isFunction + isString + optional + optionalAttrs + optionals + optionalString + pred + remove + switch + versions + ; + + inherit (lib.attrsets) removeAttrs; + inherit (lib.strings) match; + isGitHubDomain = d: match "^github.*" d != null; isGitLabDomain = d: match "^gitlab.*" d != null; in + { pname, version ? null, fetcher ? null, diff --git a/pkgs/build-support/coq/extra-lib.nix b/pkgs/build-support/coq/extra-lib.nix index 3c226b4920b6..94de7c0113d8 100644 --- a/pkgs/build-support/coq/extra-lib.nix +++ b/pkgs/build-support/coq/extra-lib.nix @@ -1,5 +1,25 @@ { lib }: -with builtins; with lib; recursiveUpdate lib (rec { + +let + inherit (lib) + all + concatStringsSep + findFirst + flip + getAttr + head + isFunction + length + recursiveUpdate + splitVersion + tail + take + versionAtLeast + versionOlder + zipListsWith + ; +in +recursiveUpdate lib (rec { versions = let diff --git a/pkgs/build-support/coq/meta-fetch/default.nix b/pkgs/build-support/coq/meta-fetch/default.nix index 82c29fb760b7..daed9faa3efe 100644 --- a/pkgs/build-support/coq/meta-fetch/default.nix +++ b/pkgs/build-support/coq/meta-fetch/default.nix @@ -1,8 +1,33 @@ { lib, stdenv, fetchzip }@args: -let lib' = lib; in -let lib = import ../extra-lib.nix {lib = lib';}; in -with builtins; with lib; + let + lib = import ../extra-lib.nix { + inherit (args) lib; + }; + + inherit (lib) + attrNames + fakeSha256 + filter + findFirst + head + isAttrs + isPath + isString + last + length + optionalAttrs + pathExists + pred + sort + switch + switch-if + versionAtLeast + versions + ; + + inherit (lib.strings) match split; + default-fetcher = {domain ? "github.com", owner ? "", repo, rev, name ? "source", sha256 ? null, ...}@args: let ext = if args?sha256 then "zip" else "tar.gz"; fmt = if args?sha256 then "zip" else "tarball"; @@ -17,7 +42,7 @@ let { cond = (match "(www.)?mpi-sws.org" domain) != null; out = "https://www.mpi-sws.org/~${owner}/${repo}/download/${repo}-${rev}.${ext}";} ] (throw "meta-fetch: no fetcher found for domain ${domain} on ${rev}"); - fetch = x: if args?sha256 then fetchzip (x // { inherit sha256; }) else fetchTarball x; + fetch = x: if args?sha256 then fetchzip (x // { inherit sha256; }) else builtins.fetchTarball x; in fetch { inherit url ; }; in { @@ -38,11 +63,12 @@ switch arg [ { case = isNull; out = { version = "broken"; src = ""; broken = true; }; } { case = isPathString; out = { version = "dev"; src = arg; }; } { case = pred.union isVersion isShortVersion; - out = let v = if isVersion arg then arg else shortVersion arg; in - let - given-sha256 = release.${v}.sha256 or ""; - sha256 = if given-sha256 == "" then lib.fakeSha256 else given-sha256; - rv = release.${v} // { inherit sha256; }; in + out = let + v = if isVersion arg then arg else shortVersion arg; + given-sha256 = release.${v}.sha256 or ""; + sha256 = if given-sha256 == "" then fakeSha256 else given-sha256; + rv = release.${v} // { inherit sha256; }; + in { version = rv.version or v; src = rv.src or fetcher (location // { rev = releaseRev v; } // rv); diff --git a/pkgs/build-support/fetchrepoproject/default.nix b/pkgs/build-support/fetchrepoproject/default.nix index 78b8caeb8091..a5e79c8d4ef9 100644 --- a/pkgs/build-support/fetchrepoproject/default.nix +++ b/pkgs/build-support/fetchrepoproject/default.nix @@ -9,9 +9,14 @@ assert repoRepoRev != "" -> repoRepoURL != ""; assert createMirror -> !useArchive; -with lib; - let + inherit (lib) + concatMapStringsSep + concatStringsSep + fetchers + optionalString + ; + extraRepoInitFlags = [ (optionalString (repoRepoURL != "") "--repo-url=${repoRepoURL}") (optionalString (repoRepoRev != "") "--repo-branch=${repoRepoRev}") diff --git a/pkgs/build-support/fetchsourcehut/default.nix b/pkgs/build-support/fetchsourcehut/default.nix index ed6e85bd639b..42d437b3555e 100644 --- a/pkgs/build-support/fetchsourcehut/default.nix +++ b/pkgs/build-support/fetchsourcehut/default.nix @@ -1,6 +1,14 @@ { fetchgit, fetchhg, fetchzip, lib }: -lib.makeOverridable ( +let + inherit (lib) + assertOneOf + makeOverridable + optionalString + ; +in + +makeOverridable ( { owner , repo, rev , domain ? "sr.ht" @@ -10,9 +18,7 @@ lib.makeOverridable ( , ... # For hash agility } @ args: -with lib; - -assert (lib.assertOneOf "vc" vc [ "hg" "git" ]); +assert (assertOneOf "vc" vc [ "hg" "git" ]); let urlFor = resource: "https://${resource}.${domain}/${owner}/${repo}"; diff --git a/pkgs/build-support/nix-gitignore/default.nix b/pkgs/build-support/nix-gitignore/default.nix index c047bfc7d9a2..849720675c89 100644 --- a/pkgs/build-support/nix-gitignore/default.nix +++ b/pkgs/build-support/nix-gitignore/default.nix @@ -7,9 +7,32 @@ # - zero or more directories. For example, "a/**/b" matches "a/b", # - "a/x/b", "a/x/y/b" and so on. -with builtins; - let + inherit (builtins) filterSource; + + inherit (lib) + concatStringsSep + elemAt + filter + head + isList + length + optionals + optionalString + pathExists + readFile + removePrefix + replaceStrings + stringLength + sub + substring + toList + trace + ; + + + inherit (lib.strings) match split typeOf; + debug = a: trace a a; last = l: elemAt l ((length l) - 1); in rec { @@ -17,7 +40,7 @@ in rec { filterPattern = patterns: root: (name: _type: let - relPath = lib.removePrefix ((toString root) + "/") name; + relPath = removePrefix ((toString root) + "/") name; matches = pair: (match (head pair) relPath) != null; matched = map (pair: [(matches pair) (last pair)]) patterns; in @@ -45,7 +68,7 @@ in rec { escs = "\\*?"; splitString = let recurse = str : [(substring 0 1 str)] ++ - (lib.optionals (str != "") (recurse (substring 1 (stringLength(str)) str) )); + (optionals (str != "") (recurse (substring 1 (stringLength(str)) str) )); in str : recurse str; chars = s: filter (c: c != "" && !isList c) (splitString s); escape = s: map (c: "\\" + c) (chars s); @@ -66,7 +89,7 @@ in rec { handleSlashPrefix = l: let split = (match "^(/?)(.*)" l); - findSlash = l: lib.optionalString ((match ".+/.+" l) == null) l; + findSlash = l: optionalString ((match ".+/.+" l) == null) l; hasSlash = mapAroundCharclass findSlash l != l; in (if (elemAt split 0) == "/" || hasSlash @@ -94,12 +117,12 @@ in rec { gitignoreCompileIgnore = file_str_patterns: root: let onPath = f: a: if typeOf a == "path" then f a else a; - str_patterns = map (onPath readFile) (lib.toList file_str_patterns); + str_patterns = map (onPath readFile) (toList file_str_patterns); in concatStringsSep "\n" str_patterns; - gitignoreFilterPure = filter: patterns: root: name: type: + gitignoreFilterPure = predicate: patterns: root: name: type: gitignoreFilter (gitignoreCompileIgnore patterns root) root name type - && filter name type; + && predicate name type; # This is a very hacky way of programming this! # A better way would be to reuse existing filtering by making multiple gitignore functions per each root. @@ -145,23 +168,23 @@ in rec { ''); withGitignoreFile = patterns: root: - lib.toList patterns ++ [ ".git" ] ++ [(root + "/.gitignore")]; + toList patterns ++ [ ".git" ] ++ [(root + "/.gitignore")]; withRecursiveGitignoreFile = patterns: root: - lib.toList patterns ++ [ ".git" ] ++ [(compileRecursiveGitignore root)]; + toList patterns ++ [ ".git" ] ++ [(compileRecursiveGitignore root)]; # filterSource derivatives - gitignoreFilterSourcePure = filter: patterns: root: - filterSource (gitignoreFilterPure filter patterns root) root; + gitignoreFilterSourcePure = predicate: patterns: root: + filterSource (gitignoreFilterPure predicate patterns root) root; - gitignoreFilterSource = filter: patterns: root: - gitignoreFilterSourcePure filter (withGitignoreFile patterns root) root; + gitignoreFilterSource = predicate: patterns: root: + gitignoreFilterSourcePure predicate (withGitignoreFile patterns root) root; - gitignoreFilterRecursiveSource = filter: patterns: root: - gitignoreFilterSourcePure filter (withRecursiveGitignoreFile patterns root) root; + gitignoreFilterRecursiveSource = predicate: patterns: root: + gitignoreFilterSourcePure predicate (withRecursiveGitignoreFile patterns root) root; - # "Filter"-less alternatives + # "Predicate"-less alternatives gitignoreSourcePure = gitignoreFilterSourcePure (_: _: true); gitignoreSource = patterns: let type = typeOf patterns; in diff --git a/pkgs/build-support/pkg-config-wrapper/default.nix b/pkgs/build-support/pkg-config-wrapper/default.nix index f409ca3a7d4b..c7856bd1f876 100644 --- a/pkgs/build-support/pkg-config-wrapper/default.nix +++ b/pkgs/build-support/pkg-config-wrapper/default.nix @@ -10,9 +10,17 @@ , extraPackages ? [], extraBuildCommands ? "" }: -with lib; - let + inherit (lib) + attrByPath + getBin + optional + optionalAttrs + optionals + optionalString + replaceStrings + ; + stdenv = stdenvNoCC; inherit (stdenv) hostPlatform targetPlatform; @@ -20,7 +28,7 @@ let # # TODO(@Ericson2314) Make unconditional, or optional but always true by # default. - targetPrefix = lib.optionalString (targetPlatform != hostPlatform) + targetPrefix = optionalString (targetPlatform != hostPlatform) (targetPlatform.config + "-"); # See description in cc-wrapper. @@ -49,7 +57,7 @@ stdenv.mkDerivation { dontUnpack = true; # Additional flags passed to pkg-config. - addFlags = lib.optional stdenv.targetPlatform.isStatic "--static"; + addFlags = optional stdenv.targetPlatform.isStatic "--static"; installPhase = '' @@ -119,10 +127,10 @@ stdenv.mkDerivation { }; meta = - let pkg-config_ = lib.optionalAttrs (pkg-config != null) pkg-config; in - (lib.optionalAttrs (pkg-config_ ? meta) (removeAttrs pkg-config.meta ["priority"])) // + let pkg-config_ = optionalAttrs (pkg-config != null) pkg-config; in + (optionalAttrs (pkg-config_ ? meta) (removeAttrs pkg-config.meta ["priority"])) // { description = - lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_ + attrByPath ["meta" "description"] "pkg-config" pkg-config_ + " (wrapper script)"; priority = 10; }; diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix index 1cc6a5812f1f..f5ab2db1a754 100644 --- a/pkgs/build-support/release/default.nix +++ b/pkgs/build-support/release/default.nix @@ -1,6 +1,24 @@ { lib, pkgs }: -with pkgs; +let + inherit (lib) optionalString; + + inherit (pkgs) + autoconf + automake + checkinstall + clang-analyzer + cov-build + enableGCOVInstrumentation + lcov + libtool + makeGCOVReport + runCommand + stdenv + vmTools + xz + ; +in rec { @@ -91,7 +109,7 @@ rec { dontConfigure = true; dontBuild = true; - patchPhase = lib.optionalString isNixOS '' + patchPhase = optionalString isNixOS '' touch .update-on-nixos-rebuild ''; diff --git a/pkgs/build-support/replace-dependency.nix b/pkgs/build-support/replace-dependency.nix index 5b4c127cdd8e..7912d21bfd69 100644 --- a/pkgs/build-support/replace-dependency.nix +++ b/pkgs/build-support/replace-dependency.nix @@ -19,9 +19,20 @@ # (and all of its dependencies) without rebuilding further. { drv, oldDependency, newDependency, verbose ? true }: -with lib; - let + inherit (lib) + any + attrNames + concatStringsSep + elem + filter + filterAttrs + listToAttrs + mapAttrsToList + stringLength + substring + ; + warn = if verbose then builtins.trace else (x: y: y); references = import (runCommandLocal "references.nix" { exportReferencesGraph = [ "graph" drv ]; } '' (echo { @@ -54,7 +65,7 @@ let (drv: { name = discard (toString drv); value = elem oldStorepath (referencesOf drv) || any dependsOnOld (referencesOf drv); - }) (builtins.attrNames references)); + }) (attrNames references)); dependsOnOld = drv: dependsOnOldMemo.${discard (toString drv)}; @@ -74,9 +85,9 @@ let rewriteMemo = listToAttrs (map (drv: { name = discard (toString drv); value = rewriteHashes (builtins.storePath drv) - (filterAttrs (n: v: builtins.elem (builtins.storePath (discard (toString n))) (referencesOf drv)) rewriteMemo); + (filterAttrs (n: v: elem (builtins.storePath (discard (toString n))) (referencesOf drv)) rewriteMemo); }) - (filter dependsOnOld (builtins.attrNames references))) // rewrittenDeps; + (filter dependsOnOld (attrNames references))) // rewrittenDeps; drvHash = discard (toString drv); in assert (stringLength (drvName (toString oldDependency)) == stringLength (drvName (toString newDependency))); diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.sh b/pkgs/build-support/setup-hooks/auto-patchelf.sh index 9f6366b3feae..783ea45f8eeb 100644 --- a/pkgs/build-support/setup-hooks/auto-patchelf.sh +++ b/pkgs/build-support/setup-hooks/auto-patchelf.sh @@ -88,22 +88,21 @@ autoPatchelf() { --extra-args "${patchelfFlagsArray[@]}" } -# XXX: This should ultimately use fixupOutputHooks but we currently don't have -# a way to enforce the order. If we have $runtimeDependencies set, the setup -# hook of patchelf is going to ruin everything and strip out those additional -# RPATHs. -# -# So what we do here is basically run in postFixup and emulate the same -# behaviour as fixupOutputHooks because the setup hook for patchelf is run in -# fixupOutput and the postFixup hook runs later. -# -# shellcheck disable=SC2016 -# (Expressions don't expand in single quotes, use double quotes for that.) -postFixupHooks+=(' - if [ -z "${dontAutoPatchelf-}" ]; then +autoPatchelfPostFixup() { + # XXX: This should ultimately use fixupOutputHooks but we currently don't have + # a way to enforce the order. If we have $runtimeDependencies set, the setup + # hook of patchelf is going to ruin everything and strip out those additional + # RPATHs. + # + # So what we do here is basically run in postFixup and emulate the same + # behaviour as fixupOutputHooks because the setup hook for patchelf is run in + # fixupOutput and the postFixup hook runs later. + if [[ -z "${dontAutoPatchelf-}" ]]; then autoPatchelf -- $(for output in $(getAllOutputNames); do [ -e "${!output}" ] || continue echo "${!output}" done) fi -') +} + +postFixupHooks+=(autoPatchelfPostFixup) diff --git a/pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh b/pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh index 6cd01f6bf630..3948342a36fc 100644 --- a/pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh @@ -19,6 +19,7 @@ assertExecutable() { # (if unset or empty, defaults to EXECUTABLE) # --inherit-argv0 : the executable inherits argv0 from the wrapper. # (use instead of --argv0 '$0') +# --resolve-argv0 : if argv0 doesn't include a / character, resolve it against PATH # --set VAR VAL : add VAR with value VAL to the executable's environment # --set-default VAR VAL : like --set, but only adds VAR if not already set in # the environment @@ -87,6 +88,7 @@ makeDocumentedCWrapper() { makeCWrapper() { local argv0 inherit_argv0 n params cmd main flagsBefore flagsAfter flags executable length local uses_prefix uses_suffix uses_assert uses_assert_success uses_stdio uses_asprintf + local resolve_path executable=$(escapeStringLiteral "$1") params=("$@") length=${#params[*]} @@ -169,6 +171,12 @@ makeCWrapper() { # Whichever comes last of --argv0 and --inherit-argv0 wins inherit_argv0=1 ;; + --resolve-argv0) + # this gets processed after other argv0 flags + uses_stdio=1 + uses_string=1 + resolve_argv0=1 + ;; *) # Using an error macro, we will make sure the compiler gives an understandable error message main="$main#error makeCWrapper: Unknown argument ${p}"$'\n' ;; @@ -176,6 +184,7 @@ makeCWrapper() { done [[ -z "$flagsBefore" && -z "$flagsAfter" ]] || main="$main"${main:+$'\n'}$(addFlags "$flagsBefore" "$flagsAfter")$'\n'$'\n' [ -z "$inherit_argv0" ] && main="${main}argv[0] = \"${argv0:-${executable}}\";"$'\n' + [ -z "$resolve_argv0" ] || main="${main}argv[0] = resolve_argv0(argv[0]);"$'\n' main="${main}return execv(\"${executable}\", argv);"$'\n' [ -z "$uses_asprintf" ] || printf '%s\n' "#define _GNU_SOURCE /* See feature_test_macros(7) */" @@ -183,9 +192,11 @@ makeCWrapper() { printf '%s\n' "#include " [ -z "$uses_assert" ] || printf '%s\n' "#include " [ -z "$uses_stdio" ] || printf '%s\n' "#include " + [ -z "$uses_string" ] || printf '%s\n' "#include " [ -z "$uses_assert_success" ] || printf '\n%s\n' "#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0)" [ -z "$uses_prefix" ] || printf '\n%s\n' "$(setEnvPrefixFn)" [ -z "$uses_suffix" ] || printf '\n%s\n' "$(setEnvSuffixFn)" + [ -z "$resolve_argv0" ] || printf '\n%s\n' "$(resolveArgv0Fn)" printf '\n%s' "int main(int argc, char **argv) {" printf '\n%s' "$(indent4 "$main")" printf '\n%s\n' "}" @@ -338,6 +349,41 @@ void set_env_suffix(char *env, char *sep, char *suffix) { " } +resolveArgv0Fn() { + printf '%s' "\ +char *resolve_argv0(char *argv0) { + if (strchr(argv0, '/') != NULL) { + return argv0; + } + char *path = getenv(\"PATH\"); + if (path == NULL) { + return argv0; + } + char *path_copy = strdup(path); + if (path_copy == NULL) { + return argv0; + } + char *dir = strtok(path_copy, \":\"); + while (dir != NULL) { + char *candidate = malloc(strlen(dir) + strlen(argv0) + 2); + if (candidate == NULL) { + free(path_copy); + return argv0; + } + sprintf(candidate, \"%s/%s\", dir, argv0); + if (access(candidate, X_OK) == 0) { + free(path_copy); + return candidate; + } + free(candidate); + dir = strtok(NULL, \":\"); + } + free(path_copy); + return argv0; +} +" +} + # Embed a C string which shows up as readable text in the compiled binary wrapper, # giving instructions for recreating the wrapper. # Keep in sync with makeBinaryWrapper.extractCmd diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh index 11b332bfc3eb..cba158bd31ea 100644 --- a/pkgs/build-support/setup-hooks/make-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-wrapper.sh @@ -15,6 +15,7 @@ assertExecutable() { # (if unset or empty, defaults to EXECUTABLE) # --inherit-argv0 : the executable inherits argv0 from the wrapper. # (use instead of --argv0 '$0') +# --resolve-argv0 : if argv0 doesn't include a / character, resolve it against PATH # --set VAR VAL : add VAR with value VAL to the executable's environment # --set-default VAR VAL : like --set, but only adds VAR if not already set in # the environment @@ -177,6 +178,9 @@ makeShellWrapper() { elif [[ "$p" == "--inherit-argv0" ]]; then # Whichever comes last of --argv0 and --inherit-argv0 wins argv0='$0' + elif [[ "$p" == "--resolve-argv0" ]]; then + # this is noop in shell wrappers, since bash will always resolve $0 + resolve_argv0=1 else die "makeWrapper doesn't understand the arg $p" fi diff --git a/pkgs/build-support/vm/test.nix b/pkgs/build-support/vm/test.nix index ae6a10dea3b9..50dbfeb750be 100644 --- a/pkgs/build-support/vm/test.nix +++ b/pkgs/build-support/vm/test.nix @@ -1,5 +1,21 @@ -with import ../../.. { }; -with vmTools; +let + pkgs = import ../../.. { }; + + inherit (pkgs) + hello + patchelf + pcmanfm + stdenv + ; + + inherit (pkgs.vmTools) + buildRPM + diskImages + makeImageTestScript + runInLinuxImage + runInLinuxVM + ; +in { diff --git a/pkgs/build-support/writers/scripts.nix b/pkgs/build-support/writers/scripts.nix index 1dd25c500719..06d763ca9d6a 100644 --- a/pkgs/build-support/writers/scripts.nix +++ b/pkgs/build-support/writers/scripts.nix @@ -1,4 +1,14 @@ -{ pkgs, buildPackages, lib, stdenv, libiconv, mkNugetDeps, mkNugetSource, gixy }: +{ + buildPackages, + gixy, + lib, + libiconv, + makeBinaryWrapper, + mkNugetDeps, + mkNugetSource, + pkgs, + stdenv, +}: let inherit (lib) concatMapStringsSep @@ -6,7 +16,6 @@ let escapeShellArg last optionalString - stringLength strings types ; @@ -18,137 +27,285 @@ rec { # Examples: # writeBash = makeScriptWriter { interpreter = "${pkgs.bash}/bin/bash"; } # makeScriptWriter { interpreter = "${pkgs.dash}/bin/dash"; } "hello" "echo hello world" - makeScriptWriter = { interpreter, check ? "" }: nameOrPath: content: + makeScriptWriter = { interpreter, check ? "", makeWrapperArgs ? [], }: nameOrPath: content: assert (types.path.check nameOrPath) || (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); assert (types.path.check content) || (types.str.check content); let + nameIsPath = types.path.check nameOrPath; name = last (builtins.split "/" nameOrPath); - in + path = if nameIsPath then nameOrPath else "/bin/${name}"; + # The inner derivation which creates the executable under $out/bin (never at $out directly) + # This is required in order to support wrapping, as wrapped programs consist of at least two files: the executable and the wrapper. + inner = + pkgs.runCommandLocal name ( + { + inherit makeWrapperArgs; + nativeBuildInputs = [ + makeBinaryWrapper + ]; + meta.mainProgram = name; + } + // ( + if (types.str.check content) then { + inherit content interpreter; + passAsFile = [ "content" ]; + } else { + inherit interpreter; + contentPath = content; + } + ) + ) + '' + # On darwin a script cannot be used as an interpreter in a shebang but + # there doesn't seem to be a limit to the size of shebang and multiple + # arguments to the interpreter are allowed. + if [[ -n "${toString pkgs.stdenvNoCC.isDarwin}" ]] && isScript $interpreter + then + wrapperInterpreterLine=$(head -1 "$interpreter" | tail -c+3) + # Get first word from the line (note: xargs echo remove leading spaces) + wrapperInterpreter=$(echo "$wrapperInterpreterLine" | xargs echo | cut -d " " -f1) - pkgs.runCommandLocal name ( - lib.optionalAttrs (nameOrPath == "/bin/${name}") { - meta.mainProgram = name; - } - // ( - if (types.str.check content) then { - inherit content interpreter; - passAsFile = [ "content" ]; - } else { - inherit interpreter; - contentPath = content; - } - ) - ) - '' - # On darwin a script cannot be used as an interpreter in a shebang but - # there doesn't seem to be a limit to the size of shebang and multiple - # arguments to the interpreter are allowed. - if [[ -n "${toString pkgs.stdenvNoCC.isDarwin}" ]] && isScript $interpreter - then - wrapperInterpreterLine=$(head -1 "$interpreter" | tail -c+3) - # Get first word from the line (note: xargs echo remove leading spaces) - wrapperInterpreter=$(echo "$wrapperInterpreterLine" | xargs echo | cut -d " " -f1) + if isScript $wrapperInterpreter + then + echo "error: passed interpreter ($interpreter) is a script which has another script ($wrapperInterpreter) as an interpreter, which is not supported." + exit 1 + fi - if isScript $wrapperInterpreter - then - echo "error: passed interpreter ($interpreter) is a script which has another script ($wrapperInterpreter) as an interpreter, which is not supported." - exit 1 - fi + # This should work as long as wrapperInterpreter is a shell, which is + # the case for programs wrapped with makeWrapper, like + # python3.withPackages etc. + interpreterLine="$wrapperInterpreterLine $interpreter" + else + interpreterLine=$interpreter + fi - # This should work as long as wrapperInterpreter is a shell, which is - # the case for programs wrapped with makeWrapper, like - # python3.withPackages etc. - interpreterLine="$wrapperInterpreterLine $interpreter" - else - interpreterLine=$interpreter - fi + echo "#! $interpreterLine" > $out + cat "$contentPath" >> $out + ${optionalString (check != "") '' + ${check} $out + ''} + chmod +x $out + + # Relocate executable + # Wrap it if makeWrapperArgs are specified + mv $out tmp + mkdir -p $out/$(dirname "${path}") + mv tmp $out/${path} + if [ -n "''${makeWrapperArgs+''${makeWrapperArgs[@]}}" ]; then + wrapProgram $out/${path} ''${makeWrapperArgs[@]} + fi + ''; + in + if nameIsPath + then inner + # In case nameOrPath is a name, the user intends the executable to be located at $out. + # This is achieved by creating a separate derivation containing a symlink at $out linking to ${inner}/bin/${name}. + # This breaks the override pattern. + # In case this turns out to be a problem, we can still add more magic + else pkgs.runCommandLocal name {} '' + ln -s ${inner}/bin/${name} $out + ''; - echo "#! $interpreterLine" > $out - cat "$contentPath" >> $out - ${optionalString (check != "") '' - ${check} $out - ''} - chmod +x $out - ${optionalString (types.path.check nameOrPath) '' - mv $out tmp - mkdir -p $out/$(dirname "${nameOrPath}") - mv tmp $out/${nameOrPath} - ''} - ''; # Base implementation for compiled executables. # Takes a compile script, which in turn takes the name as an argument. # # Examples: # writeSimpleC = makeBinWriter { compileScript = name: "gcc -o $out $contentPath"; } - makeBinWriter = { compileScript, strip ? true }: nameOrPath: content: + makeBinWriter = { compileScript, strip ? true, makeWrapperArgs ? [] }: nameOrPath: content: assert (types.path.check nameOrPath) || (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); assert (types.path.check content) || (types.str.check content); let + nameIsPath = types.path.check nameOrPath; name = last (builtins.split "/" nameOrPath); + path = if nameIsPath then nameOrPath else "/bin/${name}"; + # The inner derivation which creates the executable under $out/bin (never at $out directly) + # This is required in order to support wrapping, as wrapped programs consist of at least two files: the executable and the wrapper. + inner = + pkgs.runCommandLocal name ( + { + inherit makeWrapperArgs; + nativeBuildInputs = [ + makeBinaryWrapper + ]; + meta.mainProgram = name; + } + // ( + if (types.str.check content) then { + inherit content; + passAsFile = [ "content" ]; + } else { + contentPath = content; + } + ) + ) + '' + ${compileScript} + ${lib.optionalString strip + "${lib.getBin buildPackages.bintools-unwrapped}/bin/${buildPackages.bintools-unwrapped.targetPrefix}strip -S $out"} + # Sometimes binaries produced for darwin (e. g. by GHC) won't be valid + # mach-o executables from the get-go, but need to be corrected somehow + # which is done by fixupPhase. + ${lib.optionalString pkgs.stdenvNoCC.hostPlatform.isDarwin "fixupPhase"} + mv $out tmp + mkdir -p $out/$(dirname "${path}") + mv tmp $out/${path} + if [ -n "''${makeWrapperArgs+''${makeWrapperArgs[@]}}" ]; then + wrapProgram $out/${path} ''${makeWrapperArgs[@]} + fi + ''; in - pkgs.runCommand name ((if (types.str.check content) then { - inherit content; - passAsFile = [ "content" ]; - } else { - contentPath = content; - }) // lib.optionalAttrs (nameOrPath == "/bin/${name}") { - meta.mainProgram = name; - }) '' - ${compileScript} - ${lib.optionalString strip - "${lib.getBin buildPackages.bintools-unwrapped}/bin/${buildPackages.bintools-unwrapped.targetPrefix}strip -S $out"} - # Sometimes binaries produced for darwin (e. g. by GHC) won't be valid - # mach-o executables from the get-go, but need to be corrected somehow - # which is done by fixupPhase. - ${lib.optionalString pkgs.stdenvNoCC.hostPlatform.isDarwin "fixupPhase"} - ${optionalString (types.path.check nameOrPath) '' - mv $out tmp - mkdir -p $out/$(dirname "${nameOrPath}") - mv tmp $out/${nameOrPath} - ''} - ''; + if nameIsPath + then inner + # In case nameOrPath is a name, the user intends the executable to be located at $out. + # This is achieved by creating a separate derivation containing a symlink at $out linking to ${inner}/bin/${name}. + # This breaks the override pattern. + # In case this turns out to be a problem, we can still add more magic + else pkgs.runCommandLocal name {} '' + ln -s ${inner}/bin/${name} $out + ''; # Like writeScript but the first line is a shebang to bash # - # Example: + # Can be called with or without extra arguments. + # + # Example without arguments: # writeBash "example" '' # echo hello world # '' - writeBash = makeScriptWriter { - interpreter = "${lib.getExe pkgs.bash}"; - }; + # + # Example with arguments: + # writeBash "example" + # { + # makeWrapperArgs = [ + # "--prefix" "PATH" ":" "${pkgs.hello}/bin" + # ]; + # } + # '' + # hello + # '' + writeBash = name: argsOrScript: + if lib.isAttrs argsOrScript && ! lib.isDerivation argsOrScript + then makeScriptWriter (argsOrScript // { interpreter = "${lib.getExe pkgs.bash}"; }) name + else makeScriptWriter { interpreter = "${lib.getExe pkgs.bash}"; } name argsOrScript; # Like writeScriptBin but the first line is a shebang to bash + # + # Can be called with or without extra arguments. + # + # Example without arguments: + # writeBashBin "example" '' + # echo hello world + # '' + # + # Example with arguments: + # writeBashBin "example" + # { + # makeWrapperArgs = [ + # "--prefix", "PATH", ":", "${pkgs.hello}/bin", + # ]; + # } + # '' + # hello + # '' writeBashBin = name: writeBash "/bin/${name}"; # Like writeScript but the first line is a shebang to dash # - # Example: + # Can be called with or without extra arguments. + # + # Example without arguments: # writeDash "example" '' # echo hello world # '' - writeDash = makeScriptWriter { - interpreter = "${lib.getExe pkgs.dash}"; - }; + # + # Example with arguments: + # writeDash "example" + # { + # makeWrapperArgs = [ + # "--prefix", "PATH", ":", "${pkgs.hello}/bin", + # ]; + # } + # '' + # hello + # '' + writeDash = name: argsOrScript: + if lib.isAttrs argsOrScript && ! lib.isDerivation argsOrScript + then makeScriptWriter (argsOrScript // { interpreter = "${lib.getExe pkgs.dash}"; }) name + else makeScriptWriter { interpreter = "${lib.getExe pkgs.dash}"; } name argsOrScript; # Like writeScriptBin but the first line is a shebang to dash + # + # Can be called with or without extra arguments. + # + # Example without arguments: + # writeDashBin "example" '' + # echo hello world + # '' + # + # Example with arguments: + # writeDashBin "example" + # { + # makeWrapperArgs = [ + # "--prefix", "PATH", ":", "${pkgs.hello}/bin", + # ]; + # } + # '' + # hello + # '' writeDashBin = name: writeDash "/bin/${name}"; # Like writeScript but the first line is a shebang to fish # - # Example: + # Can be called with or without extra arguments. + # + # Example without arguments: # writeFish "example" '' # echo hello world # '' - writeFish = makeScriptWriter { - interpreter = "${lib.getExe pkgs.fish} --no-config"; - check = "${lib.getExe pkgs.fish} --no-config --no-execute"; # syntax check only - }; + # + # Example with arguments: + # writeFish "example" + # { + # makeWrapperArgs = [ + # "--prefix", "PATH", ":", "${pkgs.hello}/bin", + # ]; + # } + # '' + # hello + # '' + writeFish = name: argsOrScript: + if lib.isAttrs argsOrScript && ! lib.isDerivation argsOrScript + then makeScriptWriter (argsOrScript // { + interpreter = "${lib.getExe pkgs.fish} --no-config"; + check = "${lib.getExe pkgs.fish} --no-config --no-execute"; # syntax check only + }) name + else makeScriptWriter { + interpreter = "${lib.getExe pkgs.fish} --no-config"; + check = "${lib.getExe pkgs.fish} --no-config --no-execute"; # syntax check only + } name argsOrScript; # Like writeScriptBin but the first line is a shebang to fish + # + # Can be called with or without extra arguments. + # + # Example without arguments: + # writeFishBin "example" '' + # echo hello world + # '' + # + # Example with arguments: + # writeFishBin "example" + # { + # makeWrapperArgs = [ + # "--prefix", "PATH", ":", "${pkgs.hello}/bin", + # ]; + # } + # '' + # hello + # '' writeFishBin = name: writeFish "/bin/${name}"; @@ -162,11 +319,12 @@ rec { # main = launchMissiles # ''; writeHaskell = name: { - libraries ? [], ghc ? pkgs.ghc, ghcArgs ? [], + libraries ? [], + makeWrapperArgs ? [], + strip ? true, threadedRuntime ? true, - strip ? true }: let appendIfNotSet = el: list: if elem el list then list else list ++ [ el ]; @@ -178,7 +336,7 @@ rec { ${(ghc.withPackages (_: libraries ))}/bin/ghc ${lib.escapeShellArgs ghcArgs'} tmp.hs mv tmp $out ''; - inherit strip; + inherit makeWrapperArgs strip; } name; # writeHaskellBin takes the same arguments as writeHaskell but outputs a directory (like writeScriptBin) @@ -187,36 +345,72 @@ rec { # Like writeScript but the first line is a shebang to nu # - # Example: + # Can be called with or without extra arguments. + # + # Example without arguments: # writeNu "example" '' # echo hello world # '' - writeNu = makeScriptWriter { - interpreter = "${lib.getExe pkgs.nushell} --no-config-file"; - }; + # + # Example with arguments: + # writeNu "example" + # { + # makeWrapperArgs = [ + # "--prefix", "PATH", ":", "${pkgs.hello}/bin", + # ]; + # } + # '' + # hello + # '' + writeNu = name: argsOrScript: + if lib.isAttrs argsOrScript && ! lib.isDerivation argsOrScript + then makeScriptWriter (argsOrScript // { interpreter = "${lib.getExe pkgs.nushell} --no-config-file"; }) name + else makeScriptWriter { interpreter = "${lib.getExe pkgs.nushell} --no-config-file"; } name argsOrScript; + # Like writeScriptBin but the first line is a shebang to nu + # + # Can be called with or without extra arguments. + # + # Example without arguments: + # writeNuBin "example" '' + # echo hello world + # '' + # + # Example with arguments: + # writeNuBin "example" + # { + # makeWrapperArgs = [ + # "--prefix", "PATH", ":", "${pkgs.hello}/bin", + # ]; + # } + # '' + # hello + # '' writeNuBin = name: writeNu "/bin/${name}"; # makeRubyWriter takes ruby and compatible rubyPackages and produces ruby script writer, # If any libraries are specified, ruby.withPackages is used as interpreter, otherwise the "bare" ruby is used. - makeRubyWriter = ruby: rubyPackages: buildRubyPackages: name: { libraries ? [], }: - makeScriptWriter { - interpreter = - if libraries == [] - then "${ruby}/bin/ruby" - else "${(ruby.withPackages (ps: libraries))}/bin/ruby"; - # Rubocop doesnt seem to like running in this fashion. - #check = (writeDash "rubocop.sh" '' - # exec ${lib.getExe buildRubyPackages.rubocop} "$1" - #''); - } name; + makeRubyWriter = ruby: rubyPackages: buildRubyPackages: name: { libraries ? [], ... } @ args: + makeScriptWriter ( + (builtins.removeAttrs args ["libraries"]) + // { + interpreter = + if libraries == [] + then "${ruby}/bin/ruby" + else "${(ruby.withPackages (ps: libraries))}/bin/ruby"; + # Rubocop doesn't seem to like running in this fashion. + #check = (writeDash "rubocop.sh" '' + # exec ${lib.getExe buildRubyPackages.rubocop} "$1" + #''); + } + ) name; # Like writeScript but the first line is a shebang to ruby # # Example: - # writeRuby "example" '' + # writeRuby "example" { libraries = [ pkgs.rubyPackages.git ]; } '' # puts "hello world" # '' writeRuby = makeRubyWriter pkgs.ruby pkgs.rubyPackages buildPackages.rubyPackages; @@ -227,17 +421,20 @@ rec { # makeLuaWriter takes lua and compatible luaPackages and produces lua script writer, # which validates the script with luacheck at build time. If any libraries are specified, # lua.withPackages is used as interpreter, otherwise the "bare" lua is used. - makeLuaWriter = lua: luaPackages: buildLuaPackages: name: { libraries ? [], }: - makeScriptWriter { - interpreter = lua.interpreter; - # if libraries == [] - # then lua.interpreter - # else (lua.withPackages (ps: libraries)).interpreter - # This should support packages! I just cant figure out why some dependency collision happens whenever I try to run this. - check = (writeDash "luacheck.sh" '' - exec ${buildLuaPackages.luacheck}/bin/luacheck "$1" - ''); - } name; + makeLuaWriter = lua: luaPackages: buildLuaPackages: name: { libraries ? [], ... } @ args: + makeScriptWriter ( + (builtins.removeAttrs args ["libraries"]) + // { + interpreter = lua.interpreter; + # if libraries == [] + # then lua.interpreter + # else (lua.withPackages (ps: libraries)).interpreter + # This should support packages! I just cant figure out why some dependency collision happens whenever I try to run this. + check = (writeDash "luacheck.sh" '' + exec ${buildLuaPackages.luacheck}/bin/luacheck "$1" + ''); + } + ) name; # writeLua takes a name an attributeset with libraries and some lua source code and # returns an executable (should also work with luajit) @@ -265,9 +462,10 @@ rec { writeLua "/bin/${name}"; writeRust = name: { - rustc ? pkgs.rustc, - rustcArgs ? [], - strip ? true + makeWrapperArgs ? [], + rustc ? pkgs.rustc, + rustcArgs ? [], + strip ? true, }: let darwinArgs = lib.optionals stdenv.isDarwin [ "-L${lib.getLib libiconv}/lib" ]; @@ -277,7 +475,7 @@ rec { cp "$contentPath" tmp.rs PATH=${lib.makeBinPath [pkgs.gcc]} ${rustc}/bin/rustc ${lib.escapeShellArgs rustcArgs} ${lib.escapeShellArgs darwinArgs} -o "$out" tmp.rs ''; - inherit strip; + inherit makeWrapperArgs strip; } name; writeRustBin = name: @@ -337,10 +535,13 @@ rec { # use boolean; # print "Howdy!\n" if true; # '' - writePerl = name: { libraries ? [] }: - makeScriptWriter { - interpreter = "${lib.getExe (pkgs.perl.withPackages (p: libraries))}"; - } name; + writePerl = name: { libraries ? [], ... } @ args: + makeScriptWriter ( + (builtins.removeAttrs args ["libraries"]) + // { + interpreter = "${lib.getExe (pkgs.perl.withPackages (p: libraries))}"; + } + ) name; # writePerlBin takes the same arguments as writePerl but outputs a directory (like writeScriptBin) writePerlBin = name: @@ -349,22 +550,27 @@ rec { # makePythonWriter takes python and compatible pythonPackages and produces python script writer, # which validates the script with flake8 at build time. If any libraries are specified, # python.withPackages is used as interpreter, otherwise the "bare" python is used. - makePythonWriter = python: pythonPackages: buildPythonPackages: name: { libraries ? [], flakeIgnore ? [] }: + makePythonWriter = python: pythonPackages: buildPythonPackages: name: { libraries ? [], flakeIgnore ? [], ... } @ args: let ignoreAttribute = optionalString (flakeIgnore != []) "--ignore ${concatMapStringsSep "," escapeShellArg flakeIgnore}"; in - makeScriptWriter { - interpreter = - if pythonPackages != pkgs.pypy2Packages || pythonPackages != pkgs.pypy3Packages then - if libraries == [] - then python.interpreter - else (python.withPackages (ps: libraries)).interpreter - else python.interpreter - ; - check = optionalString python.isPy3k (writeDash "pythoncheck.sh" '' - exec ${buildPythonPackages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1" - ''); - } name; + makeScriptWriter + ( + (builtins.removeAttrs args ["libraries" "flakeIgnore"]) + // { + interpreter = + if pythonPackages != pkgs.pypy2Packages || pythonPackages != pkgs.pypy3Packages then + if libraries == [] + then python.interpreter + else (python.withPackages (ps: libraries)).interpreter + else python.interpreter + ; + check = optionalString python.isPy3k (writeDash "pythoncheck.sh" '' + exec ${buildPythonPackages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1" + ''); + } + ) + name; # writePyPy2 takes a name an attributeset with libraries and some pypy2 sourcecode and # returns an executable @@ -421,7 +627,7 @@ rec { writePyPy3 "/bin/${name}"; - makeFSharpWriter = { dotnet-sdk ? pkgs.dotnet-sdk, fsi-flags ? "", libraries ? _: [] }: nameOrPath: + makeFSharpWriter = { dotnet-sdk ? pkgs.dotnet-sdk, fsi-flags ? "", libraries ? _: [], ... } @ args: nameOrPath: let fname = last (builtins.split "/" nameOrPath); path = if strings.hasSuffix ".fsx" nameOrPath then nameOrPath else "${nameOrPath}.fsx"; @@ -442,9 +648,12 @@ rec { ${lib.getExe dotnet-sdk} fsi --quiet --nologo --readline- ${fsi-flags} "$@" < "$script" ''; - in content: makeScriptWriter { - interpreter = fsi; - } path + in content: makeScriptWriter ( + (builtins.removeAttrs args ["dotnet-sdk" "fsi-flags" "libraries"]) + // { + interpreter = fsi; + } + ) path '' #i "nuget: ${nuget-source}/lib" ${ content } @@ -456,5 +665,4 @@ rec { writeFSharpBin = name: writeFSharp "/bin/${name}"; - } diff --git a/pkgs/build-support/writers/test.nix b/pkgs/build-support/writers/test.nix index 982c550d28e0..656d127930fa 100644 --- a/pkgs/build-support/writers/test.nix +++ b/pkgs/build-support/writers/test.nix @@ -1,13 +1,8 @@ -{ glib -, haskellPackages +{ haskellPackages , lib , nodePackages , perlPackages -, pypy2Packages , python3Packages -, pypy3Packages -, luaPackages -, rubyPackages , runCommand , testers , writers @@ -16,8 +11,38 @@ # If you are reading this, you can test these writers by running: nix-build . -A tests.writers -with writers; let + inherit (lib) getExe recurseIntoAttrs; + + inherit (writers) + makeFSharpWriter + writeBash + writeBashBin + writeDash + writeDashBin + writeFish + writeFishBin + writeFSharp + writeHaskell + writeHaskellBin + writeJS + writeJSBin + writeJSON + writeLua + writeNu + writePerl + writePerlBin + writePyPy3 + writePython3 + writePython3Bin + writeRuby + writeRust + writeRustBin + writeText + writeTOML + writeYAML + ; + expectSuccess = test: runCommand "run-${test.name}" {} '' if [[ "$(${test})" != success ]]; then @@ -30,7 +55,7 @@ let expectSuccessBin = test: runCommand "run-${test.name}" {} '' - if [[ "$(${lib.getExe test})" != success ]]; then + if [[ "$(${getExe test})" != success ]]; then echo 'test ${test.name} failed' exit 1 fi @@ -44,8 +69,8 @@ let in testers.testEqualContents { expected = expectedFile; actual = file; assertion = "${file.name} matches"; }; in -lib.recurseIntoAttrs { - bin = lib.recurseIntoAttrs { +recurseIntoAttrs { + bin = recurseIntoAttrs { bash = expectSuccessBin (writeBashBin "test-writers-bash-bin" '' if [[ "test" == "test" ]]; then echo "success"; fi ''); @@ -145,7 +170,7 @@ lib.recurseIntoAttrs { #''); }; - simple = lib.recurseIntoAttrs { + simple = recurseIntoAttrs { bash = expectSuccess (writeBash "test-writers-bash" '' if [[ "test" == "test" ]]; then echo "success"; fi ''); @@ -270,7 +295,7 @@ lib.recurseIntoAttrs { ''); }; - path = lib.recurseIntoAttrs { + path = recurseIntoAttrs { bash = expectSuccess (writeBash "test-writers-bash-path" (writeText "test" '' if [[ "test" == "test" ]]; then echo "success"; fi '')); @@ -310,4 +335,85 @@ lib.recurseIntoAttrs { expected = "hello: world\n"; }; }; + + wrapping = recurseIntoAttrs { + bash-bin = expectSuccessBin ( + writeBashBin "test-writers-wrapping-bash-bin" + { + makeWrapperArgs = [ + "--set" + "ThaigerSprint" + "Thailand" + ]; + } + '' + if [[ "$ThaigerSprint" == "Thailand" ]]; then + echo "success" + fi + '' + ); + + bash = expectSuccess ( + writeBash "test-writers-wrapping-bash" + { + makeWrapperArgs = [ + "--set" + "ThaigerSprint" + "Thailand" + ]; + } + '' + if [[ "$ThaigerSprint" == "Thailand" ]]; then + echo "success" + fi + '' + ); + + python = expectSuccess ( + writePython3 "test-writers-wrapping-python" + { + makeWrapperArgs = [ + "--set" + "ThaigerSprint" + "Thailand" + ]; + } + '' + import os + + if os.environ.get("ThaigerSprint") == "Thailand": + print("success") + '' + ); + + rust = expectSuccess ( + writeRust "test-writers-wrapping-rust" + { + makeWrapperArgs = [ + "--set" + "ThaigerSprint" + "Thailand" + ]; + } + '' + fn main(){ + if std::env::var("ThaigerSprint").unwrap() == "Thailand" { + println!("success") + } + } + '' + ); + + no-empty-wrapper = let + bin = writeBashBin "bin" { makeWrapperArgs = []; } ''true''; + in runCommand "run-test-writers-wrapping-no-empty-wrapper" {} '' + ls -A ${bin}/bin + if [ $(ls -A ${bin}/bin | wc -l) -eq 1 ]; then + touch $out + else + echo "Error: Empty wrapper was created" >&2 + exit 1 + fi + ''; + }; } diff --git a/pkgs/by-name/on/onevpl-intel-gpu/package.nix b/pkgs/by-name/on/onevpl-intel-gpu/package.nix new file mode 100644 index 000000000000..64e6f9d262f2 --- /dev/null +++ b/pkgs/by-name/on/onevpl-intel-gpu/package.nix @@ -0,0 +1,38 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, libdrm +, libva +}: + +stdenv.mkDerivation rec { + pname = "onevpl-intel-gpu"; + version = "23.4.3"; + + outputs = [ "out" "dev" ]; + + src = fetchFromGitHub { + owner = "oneapi-src"; + repo = "oneVPL-intel-gpu"; + rev = "intel-onevpl-${version}"; + sha256 = "sha256-oDwDMUq6JpRJH5nbANb7TJLW7HRYA9y0xZxEsoepx/U="; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + + buildInputs = [ libdrm libva ]; + + meta = { + description = "oneAPI Video Processing Library Intel GPU implementation"; + homepage = "https://github.com/oneapi-src/oneVPL-intel-gpu"; + changelog = "https://github.com/oneapi-src/oneVPL-intel-gpu/releases/tag/${src.rev}"; + license = [ lib.licenses.mit ]; + platforms = lib.platforms.linux; + # CMake adds x86 specific compiler flags in /builder/FindGlobals.cmake + # NOTE: https://github.com/oneapi-src/oneVPL-intel-gpu/issues/303 + broken = !stdenv.hostPlatform.isx86; + maintainers = [ lib.maintainers.evanrichter ]; + }; +} diff --git a/pkgs/by-name/vu/vulkan-volk/package.nix b/pkgs/by-name/vu/vulkan-volk/package.nix index 1164fd2921e2..a659f9a1c6da 100644 --- a/pkgs/by-name/vu/vulkan-volk/package.nix +++ b/pkgs/by-name/vu/vulkan-volk/package.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "volk"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "zeux"; repo = "volk"; rev = "vulkan-sdk-${finalAttrs.version}"; - hash = "sha256-uTjLgJMGN8nOVhVIl/GNhO2jXe9ebhc9vzAwCDwfuf4="; + hash = "sha256-e4TLGRqn0taYeiRVxc9WevURjO5dsVq3RpOwZBGDknQ="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/by-name/wa/waf/package.nix b/pkgs/by-name/wa/waf/package.nix index 515f3ae03421..9dd0e9339d87 100644 --- a/pkgs/by-name/wa/waf/package.nix +++ b/pkgs/by-name/wa/waf/package.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "waf"; - version = "2.0.26"; + version = "2.0.27"; src = fetchFromGitLab { owner = "ita1024"; repo = "waf"; rev = "waf-${finalAttrs.version}"; - hash = "sha256-AXDMWlwivJ0Xot6iwuIIlbV2Anz6ieghyOI9jA4yrko="; + hash = "sha256-GeEoD5CHubwR4ndGk7J7czEf0hWtPQr88TqJDPqeK0s="; }; nativeBuildInputs = [ diff --git a/pkgs/development/compilers/gcc/common/builder.nix b/pkgs/development/compilers/gcc/common/builder.nix index 98525b5e237e..25c564633865 100644 --- a/pkgs/development/compilers/gcc/common/builder.nix +++ b/pkgs/development/compilers/gcc/common/builder.nix @@ -1,6 +1,7 @@ { lib , stdenv , enableMultilib +, targetConfig }: let @@ -196,6 +197,13 @@ originalAttrs: (stdenv.mkDerivation (finalAttrs: originalAttrs // { mkdir -p "$out/''${targetConfig}/lib" mkdir -p "''${!outputLib}/''${targetConfig}/lib" '' + + # if cross-compiling, link from $lib/lib to $lib/${targetConfig}. + # since native-compiles have $lib/lib as a directory (not a + # symlink), this ensures that in every case we can assume that + # $lib/lib contains the .so files + lib.optionalString (with stdenv; targetPlatform.config != hostPlatform.config) '' + ln -Ts "''${!outputLib}/''${targetConfig}/lib" $lib/lib + '' + # Make `lib64` symlinks to `lib`. lib.optionalString (!enableMultilib && stdenv.hostPlatform.is64bit && !stdenv.hostPlatform.isMips64n32) '' ln -s lib "$out/''${targetConfig}/lib64" diff --git a/pkgs/development/compilers/gcc/common/libgcc.nix b/pkgs/development/compilers/gcc/common/libgcc.nix index c8342ae90054..a7de840adc8d 100644 --- a/pkgs/development/compilers/gcc/common/libgcc.nix +++ b/pkgs/development/compilers/gcc/common/libgcc.nix @@ -83,10 +83,6 @@ in lib.optionalString (!langC) '' rm -f $out/lib/libgcc_s.so* '' - + lib.optionalString (hostPlatform != targetPlatform) '' - mkdir -p $lib/lib/ - ln -s ${targetPlatformSlash}lib $lib/lib - '' # TODO(amjoseph): remove the `libgcc_s.so` symlinks below and replace them # with a `-L${gccForLibs.libgcc}/lib` in cc-wrapper's diff --git a/pkgs/development/compilers/gcc/default.nix b/pkgs/development/compilers/gcc/default.nix index cc3546bed22c..0144ab4cfff9 100644 --- a/pkgs/development/compilers/gcc/default.nix +++ b/pkgs/development/compilers/gcc/default.nix @@ -103,6 +103,7 @@ let inherit version; disableBootstrap = atLeast11 && !stdenv.hostPlatform.isDarwin && (atLeast12 -> !profiledCompiler); inherit (stdenv) buildPlatform hostPlatform targetPlatform; + targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; patches = callFile ./patches {}; @@ -124,6 +125,7 @@ let inherit version; buildPlatform hostPlatform targetPlatform + targetConfig patches crossMingw stageNameAddon @@ -329,7 +331,7 @@ lib.pipe ((callFile ./common/builder.nix {}) ({ ++ optional (is7 && targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419" ++ optional (is7 && targetPlatform.isNetBSD) "--disable-libcilkrts"; - targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; + inherit targetConfig; buildFlags = # we do not yet have Nix-driven profiling diff --git a/pkgs/development/compilers/swift/sourcekit-lsp/default.nix b/pkgs/development/compilers/swift/sourcekit-lsp/default.nix index a2dd73fefa13..ec05eea01bf4 100644 --- a/pkgs/development/compilers/swift/sourcekit-lsp/default.nix +++ b/pkgs/development/compilers/swift/sourcekit-lsp/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , callPackage +, fetchpatch , pkg-config , swift , swiftpm @@ -41,7 +42,11 @@ stdenv.mkDerivation { patch -p1 -d .build/checkouts/indexstore-db -i ${./patches/indexstore-db-macos-target.patch} swiftpmMakeMutable swift-tools-support-core - patch -p1 -d .build/checkouts/swift-tools-support-core -i ${./patches/force-unwrap-file-handles.patch} + patch -p1 -d .build/checkouts/swift-tools-support-core -i ${fetchpatch { + url = "https://github.com/apple/swift-tools-support-core/commit/990afca47e75cce136d2f59e464577e68a164035.patch"; + hash = "sha256-PLzWsp+syiUBHhEFS8+WyUcSae5p0Lhk7SSRdNvfouE="; + includes = [ "Sources/TSCBasic/FileSystem.swift" ]; + }} # This toggles a section specific to Xcode XCTest, which doesn't work on # Darwin, where we also use swift-corelibs-xctest. diff --git a/pkgs/development/compilers/swift/swift-driver/default.nix b/pkgs/development/compilers/swift/swift-driver/default.nix index d69a4da0eb3e..3245fa1d8787 100644 --- a/pkgs/development/compilers/swift/swift-driver/default.nix +++ b/pkgs/development/compilers/swift/swift-driver/default.nix @@ -54,7 +54,11 @@ stdenv.mkDerivation { configurePhase = generated.configure + '' swiftpmMakeMutable swift-tools-support-core - patch -p1 -d .build/checkouts/swift-tools-support-core -i ${./patches/force-unwrap-file-handles.patch} + patch -p1 -d .build/checkouts/swift-tools-support-core -i ${fetchpatch { + url = "https://github.com/apple/swift-tools-support-core/commit/990afca47e75cce136d2f59e464577e68a164035.patch"; + hash = "sha256-PLzWsp+syiUBHhEFS8+WyUcSae5p0Lhk7SSRdNvfouE="; + includes = [ "Sources/TSCBasic/FileSystem.swift" ]; + }} ''; # TODO: Tests depend on indexstore-db being provided by an existing Swift diff --git a/pkgs/development/compilers/swift/swift-driver/patches/force-unwrap-file-handles.patch b/pkgs/development/compilers/swift/swift-driver/patches/force-unwrap-file-handles.patch deleted file mode 100644 index a2f2d38c37c8..000000000000 --- a/pkgs/development/compilers/swift/swift-driver/patches/force-unwrap-file-handles.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8d9ab4b6ed24a97e8af0cc338a52aacdcf438b8c Mon Sep 17 00:00:00 2001 -From: Pavel Sobolev -Date: Tue, 21 Nov 2023 20:53:33 +0300 -Subject: [PATCH] Force-unwrap file handles. - ---- - Sources/TSCBasic/FileSystem.swift | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Sources/TSCBasic/FileSystem.swift b/Sources/TSCBasic/FileSystem.swift -index 3a63bdf..a1f3d9d 100644 ---- a/Sources/TSCBasic/FileSystem.swift -+++ b/Sources/TSCBasic/FileSystem.swift -@@ -425,7 +425,7 @@ private class LocalFileSystem: FileSystem { - if fp == nil { - throw FileSystemError(errno: errno, path) - } -- defer { fclose(fp) } -+ defer { fclose(fp!) } - - // Read the data one block at a time. - let data = BufferedOutputByteStream() -@@ -455,7 +455,7 @@ private class LocalFileSystem: FileSystem { - if fp == nil { - throw FileSystemError(errno: errno, path) - } -- defer { fclose(fp) } -+ defer { fclose(fp!) } - - // Write the data in one chunk. - var contents = bytes.contents --- -2.42.0 diff --git a/pkgs/development/compilers/swift/swift-format/default.nix b/pkgs/development/compilers/swift/swift-format/default.nix index 2f7e630e6804..a3d939b85cbd 100644 --- a/pkgs/development/compilers/swift/swift-format/default.nix +++ b/pkgs/development/compilers/swift/swift-format/default.nix @@ -1,5 +1,6 @@ { lib , stdenv +, fetchpatch , callPackage , swift , swiftpm @@ -21,7 +22,11 @@ stdenv.mkDerivation { configurePhase = generated.configure + '' swiftpmMakeMutable swift-tools-support-core - patch -p1 -d .build/checkouts/swift-tools-support-core -i ${./patches/force-unwrap-file-handles.patch} + patch -p1 -d .build/checkouts/swift-tools-support-core -i ${fetchpatch { + url = "https://github.com/apple/swift-tools-support-core/commit/990afca47e75cce136d2f59e464577e68a164035.patch"; + hash = "sha256-PLzWsp+syiUBHhEFS8+WyUcSae5p0Lhk7SSRdNvfouE="; + includes = [ "Sources/TSCBasic/FileSystem.swift" ]; + }} ''; # We only install the swift-format binary, so don't need the other products. diff --git a/pkgs/development/compilers/swift/swift-format/patches/force-unwrap-file-handles.patch b/pkgs/development/compilers/swift/swift-format/patches/force-unwrap-file-handles.patch deleted file mode 100644 index a2f2d38c37c8..000000000000 --- a/pkgs/development/compilers/swift/swift-format/patches/force-unwrap-file-handles.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8d9ab4b6ed24a97e8af0cc338a52aacdcf438b8c Mon Sep 17 00:00:00 2001 -From: Pavel Sobolev -Date: Tue, 21 Nov 2023 20:53:33 +0300 -Subject: [PATCH] Force-unwrap file handles. - ---- - Sources/TSCBasic/FileSystem.swift | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Sources/TSCBasic/FileSystem.swift b/Sources/TSCBasic/FileSystem.swift -index 3a63bdf..a1f3d9d 100644 ---- a/Sources/TSCBasic/FileSystem.swift -+++ b/Sources/TSCBasic/FileSystem.swift -@@ -425,7 +425,7 @@ private class LocalFileSystem: FileSystem { - if fp == nil { - throw FileSystemError(errno: errno, path) - } -- defer { fclose(fp) } -+ defer { fclose(fp!) } - - // Read the data one block at a time. - let data = BufferedOutputByteStream() -@@ -455,7 +455,7 @@ private class LocalFileSystem: FileSystem { - if fp == nil { - throw FileSystemError(errno: errno, path) - } -- defer { fclose(fp) } -+ defer { fclose(fp!) } - - // Write the data in one chunk. - var contents = bytes.contents --- -2.42.0 diff --git a/pkgs/development/compilers/swift/swiftpm/default.nix b/pkgs/development/compilers/swift/swiftpm/default.nix index 4a7a4ab63cce..2f3cb9530cfe 100644 --- a/pkgs/development/compilers/swift/swiftpm/default.nix +++ b/pkgs/development/compilers/swift/swiftpm/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , callPackage +, fetchpatch , cmake , ninja , git @@ -195,12 +196,22 @@ let ''; }; + # Part of this patch fixes for glibc 2.39: glibc patch 64b1a44183a3094672ed304532bedb9acc707554 + # marks the `FILE*` argument to a few functions including `ferror` & `fread` as non-null. However + # the code passes an `Optional` to these functions. + # This patch uses a `guard` which effectively unwraps the type (or throws an exception). + swift-tools-support-core-glibc-fix = fetchpatch { + url = "https://github.com/apple/swift-tools-support-core/commit/990afca47e75cce136d2f59e464577e68a164035.patch"; + hash = "sha256-PLzWsp+syiUBHhEFS8+WyUcSae5p0Lhk7SSRdNvfouE="; + includes = [ "Sources/TSCBasic/FileSystem.swift" ]; + }; + swift-tools-support-core = mkBootstrapDerivation { name = "swift-tools-support-core"; src = generated.sources.swift-tools-support-core; patches = [ - ./patches/force-unwrap-file-handles.patch + swift-tools-support-core-glibc-fix ]; buildInputs = [ @@ -389,7 +400,7 @@ in stdenv.mkDerivation (commonAttrs // { swiftpmMakeMutable swift-tools-support-core substituteInPlace .build/checkouts/swift-tools-support-core/Sources/TSCTestSupport/XCTestCasePerf.swift \ --replace 'canImport(Darwin)' 'false' - patch -p1 -d .build/checkouts/swift-tools-support-core -i ${./patches/force-unwrap-file-handles.patch} + patch -p1 -d .build/checkouts/swift-tools-support-core -i ${swift-tools-support-core-glibc-fix} # Prevent a warning about SDK directories we don't have. swiftpmMakeMutable swift-driver diff --git a/pkgs/development/compilers/swift/swiftpm/patches/force-unwrap-file-handles.patch b/pkgs/development/compilers/swift/swiftpm/patches/force-unwrap-file-handles.patch deleted file mode 100644 index a2f2d38c37c8..000000000000 --- a/pkgs/development/compilers/swift/swiftpm/patches/force-unwrap-file-handles.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8d9ab4b6ed24a97e8af0cc338a52aacdcf438b8c Mon Sep 17 00:00:00 2001 -From: Pavel Sobolev -Date: Tue, 21 Nov 2023 20:53:33 +0300 -Subject: [PATCH] Force-unwrap file handles. - ---- - Sources/TSCBasic/FileSystem.swift | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Sources/TSCBasic/FileSystem.swift b/Sources/TSCBasic/FileSystem.swift -index 3a63bdf..a1f3d9d 100644 ---- a/Sources/TSCBasic/FileSystem.swift -+++ b/Sources/TSCBasic/FileSystem.swift -@@ -425,7 +425,7 @@ private class LocalFileSystem: FileSystem { - if fp == nil { - throw FileSystemError(errno: errno, path) - } -- defer { fclose(fp) } -+ defer { fclose(fp!) } - - // Read the data one block at a time. - let data = BufferedOutputByteStream() -@@ -455,7 +455,7 @@ private class LocalFileSystem: FileSystem { - if fp == nil { - throw FileSystemError(errno: errno, path) - } -- defer { fclose(fp) } -+ defer { fclose(fp!) } - - // Write the data in one chunk. - var contents = bytes.contents --- -2.42.0 diff --git a/pkgs/development/interpreters/lua-5/hooks/default.nix b/pkgs/development/interpreters/lua-5/hooks/default.nix index 6c303f770dec..ca9c15e8a3b1 100644 --- a/pkgs/development/interpreters/lua-5/hooks/default.nix +++ b/pkgs/development/interpreters/lua-5/hooks/default.nix @@ -8,7 +8,6 @@ let callPackage = lua.pkgs.callPackage; - luaInterpreter = lua.interpreter; in { lua-setup-hook = LuaPathSearchPaths: LuaCPathSearchPaths: diff --git a/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh b/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh index 7b2d2a4d83d8..3041b7f1c3f7 100644 --- a/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh +++ b/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh @@ -13,11 +13,6 @@ nix_debug() { addToLuaSearchPathWithCustomDelimiter() { local varName="$1" local absPattern="$2" - # delete longest match starting from the lua placeholder '?' - local topDir="${absPattern%%\?*}" - - # export only if the folder exists else LUA_PATH/LUA_CPATH grow too large - if [[ ! -d "$topDir" ]]; then return; fi # export only if we haven't already got this dir in the search path if [[ ${!varName-} == *"$absPattern"* ]]; then return; fi @@ -27,7 +22,15 @@ addToLuaSearchPathWithCustomDelimiter() { # allowing relative modules to be used even when there are system modules. if [[ ! -v "${varName}" ]]; then export "${varName}=;;"; fi - export "${varName}=${!varName:+${!varName};}${absPattern}" + # export only if the folder contains lua files + shopt -s globstar + + for _file in ${absPattern/\?/\*\*}; do + export "${varName}=${!varName:+${!varName};}${absPattern}" + shopt -u globstar + return; + done + shopt -u globstar } addToLuaPath() { diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 4091fdd49e0e..2856951d9fbd 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation (finalAttrs: let luaPackages = self.pkgs; - luaversion = lib.versions.majorMinor version; + luaversion = lib.versions.majorMinor finalAttrs.version; plat = if (stdenv.isLinux && lib.versionOlder self.luaversion "5.4") then "linux" else if (stdenv.isLinux && lib.versionAtLeast self.luaversion "5.4") then "linux-readline" @@ -45,7 +45,7 @@ stdenv.mkDerivation (finalAttrs: outputs = [ "out" "doc" ]; src = fetchurl { - url = "https://www.lua.org/ftp/${finalAttrs.pname}-${finalAttrs.version}.tar.gz"; + url = "https://www.lua.org/ftp/lua-${finalAttrs.version}.tar.gz"; sha256 = hash; }; @@ -60,16 +60,11 @@ stdenv.mkDerivation (finalAttrs: inherit patches; - # we can't pass flags to the lua makefile because for portability, everything is hardcoded postPatch = '' - { - echo -e ' - #undef LUA_PATH_DEFAULT - #define LUA_PATH_DEFAULT "./share/lua/${luaversion}/?.lua;./?.lua;./?/init.lua" - #undef LUA_CPATH_DEFAULT - #define LUA_CPATH_DEFAULT "./lib/lua/${luaversion}/?.so;./?.so;./lib/lua/${luaversion}/loadall.so" - ' - } >> src/luaconf.h + sed -i "s@#define LUA_ROOT[[:space:]]*\"/usr/local/\"@#define LUA_ROOT \"$out/\"@g" src/luaconf.h + + # abort if patching didn't work + grep $out src/luaconf.h '' + lib.optionalString (!stdenv.isDarwin && !staticOnly) '' # Add a target for a shared library to the Makefile. sed -e '1s/^/LUA_SO = liblua.so/' \ @@ -102,8 +97,8 @@ stdenv.mkDerivation (finalAttrs: makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}ar rcu'"}) installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \ - TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" - else ("liblua.a" + lib.optionalString (!staticOnly) " liblua.so liblua.so.${luaversion} liblua.so.${version}" )}" ) + TO_LIB="${if stdenv.isDarwin then "liblua.${finalAttrs.version}.dylib" + else ("liblua.a" + lib.optionalString (!staticOnly) " liblua.so liblua.so.${luaversion} liblua.so.${finalAttrs.version}" )}" ) runHook postConfigure ''; @@ -128,7 +123,7 @@ stdenv.mkDerivation (finalAttrs: Name: Lua Description: An Extensible Extension Language - Version: ${version} + Version: ${finalAttrs.version} Requires: Libs: -L$out/lib -llua Cflags: -I$out/include @@ -138,7 +133,7 @@ stdenv.mkDerivation (finalAttrs: ln -s "$out/lib/pkgconfig/lua.pc" "$out/lib/pkgconfig/lua${lib.replaceStrings [ "." ] [ "" ] luaversion}.pc" # Make documentation outputs of different versions co-installable. - mv $out/share/doc/lua $out/share/doc/lua-${version} + mv $out/share/doc/lua $out/share/doc/lua-${finalAttrs.version} ''; # copied from python diff --git a/pkgs/development/interpreters/lua-5/tests/assert.sh b/pkgs/development/interpreters/lua-5/tests/assert.sh index c5783a24b2d7..b0aa3825ef93 100644 --- a/pkgs/development/interpreters/lua-5/tests/assert.sh +++ b/pkgs/development/interpreters/lua-5/tests/assert.sh @@ -3,14 +3,14 @@ # Example: # fail "It should have been but it wasn't to be" function fail() { - echo "$1" + echo -e "$1" exit 1 } function assertStringEqual() { if ! diff <(echo "$1") <(echo "$2") ; then - fail "expected \"$1\" to be equal to \"$2\"" + fail "Actual value: \"$1\"\nExpected value: \"$2\"" fi } diff --git a/pkgs/development/interpreters/lua-5/tests/default.nix b/pkgs/development/interpreters/lua-5/tests/default.nix index 7351fb7cd6f4..6ca6b153c0b6 100644 --- a/pkgs/development/interpreters/lua-5/tests/default.nix +++ b/pkgs/development/interpreters/lua-5/tests/default.nix @@ -1,12 +1,10 @@ { lua , hello , wrapLua -, lib, fetchFromGitHub -, fetchFromGitLab +, lib , pkgs }: let - runTest = lua: { name, command }: pkgs.runCommandLocal "test-${lua.name}-${name}" ({ nativeBuildInputs = [lua]; @@ -18,29 +16,47 @@ let + "touch $out" ); - wrappedHello = hello.overrideAttrs(oa: { - propagatedBuildInputs = [ - wrapLua - lua.pkgs.cjson - ]; - postFixup = '' - wrapLuaPrograms - ''; - }); + wrappedHello = hello.overrideAttrs(oa: { + propagatedBuildInputs = [ + wrapLua + lua.pkgs.cjson + ]; + postFixup = '' + wrapLuaPrograms + ''; + }); - luaWithModule = lua.withPackages(ps: [ - ps.lua-cjson - ]); + luaWithModule = lua.withPackages(ps: [ + ps.lua-cjson + ]); + + golden_LUA_PATHS = { + + # Looking at lua interpreter 'setpath' code + # for instance https://github.com/lua/lua/blob/69ea087dff1daba25a2000dfb8f1883c17545b7a/loadlib.c#L599 + # replace ";;" by ";LUA_PATH_DEFAULT;" + "5.1" = ";./?.lua;${lua}/share/lua/5.1/?.lua;${lua}/share/lua/5.1/?/init.lua;${lua}/lib/lua/5.1/?.lua;${lua}/lib/lua/5.1/?/init.lua;"; + "5.2" = ";${lua}/share/lua/5.2/?.lua;${lua}/share/lua/5.2/?/init.lua;${lua}/lib/lua/5.2/?.lua;${lua}/lib/lua/5.2/?/init.lua;./?.lua;"; + "5.3" = ";${lua}/share/lua/5.3/?.lua;${lua}/share/lua/5.3/?/init.lua;${lua}/lib/lua/5.3/?.lua;${lua}/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua;"; + # lua5.4 seems to be smarter about it and dont add the lua separators when nothing left or right + "5.4" = "${lua}/share/lua/5.4/?.lua;${lua}/share/lua/5.4/?/init.lua;${lua}/lib/lua/5.4/?.lua;${lua}/lib/lua/5.4/?/init.lua;./?.lua;./?/init.lua"; + + # luajit versions + "2.0" = ";./?.lua;${lua}/share/luajit-2.0/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;${lua}/share/lua/5.1/?.lua;${lua}/share/lua/5.1/?/init.lua;"; + "2.1" = ";./?.lua;${lua}/share/luajit-2.1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;${lua}/share/lua/5.1/?.lua;${lua}/share/lua/5.1/?/init.lua;"; + }; in pkgs.recurseIntoAttrs ({ - checkAliases = runTest lua { - name = "check-aliases"; + checkInterpreterPatch = let + golden_LUA_PATH = golden_LUA_PATHS.${lib.versions.majorMinor lua.version}; + in + runTest lua { + name = "check-default-lua-path"; command = '' + export LUA_PATH=";;" generated=$(lua -e 'print(package.path)') - golden_LUA_PATH='./share/lua/${lua.luaversion}/?.lua;./?.lua;./?/init.lua' - - assertStringContains "$generated" "$golden_LUA_PATH" + assertStringEqual "$generated" "${golden_LUA_PATH}" ''; }; diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix index 211fa56e9119..15bcfee3a44c 100644 --- a/pkgs/development/interpreters/luajit/default.nix +++ b/pkgs/development/interpreters/luajit/default.nix @@ -62,7 +62,7 @@ let else buildPackages.stdenv; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "luajit"; inherit version src; @@ -75,15 +75,6 @@ stdenv.mkDerivation rec { # passed by nixpkgs CC wrapper is insufficient on its own substituteInPlace src/Makefile --replace "#CCDEBUG= -g" "CCDEBUG= -g" fi - - { - echo -e ' - #undef LUA_PATH_DEFAULT - #define LUA_PATH_DEFAULT "./share/lua/${luaversion}/?.lua;./?.lua;./?/init.lua" - #undef LUA_CPATH_DEFAULT - #define LUA_CPATH_DEFAULT "./lib/lua/${luaversion}/?.so;./?.so;./lib/lua/${luaversion}/loadall.so" - ' - } >> src/luaconf.h ''; dontConfigure = true; @@ -122,7 +113,8 @@ stdenv.mkDerivation rec { inputs' = lib.filterAttrs (n: v: ! lib.isDerivation v && n != "passthruFun") inputs; override = attr: let lua = attr.override (inputs' // { self = lua; }); in lua; in passthruFun rec { - inherit self luaversion packageOverrides luaAttr; + inherit self packageOverrides luaAttr; + inherit (finalAttrs) luaversion; executable = "lua"; luaOnBuildForBuild = override pkgsBuildBuild.${luaAttr}; luaOnBuildForHost = override pkgsBuildHost.${luaAttr}; @@ -142,4 +134,4 @@ stdenv.mkDerivation rec { ]; maintainers = with maintainers; [ thoughtpolice smironov vcunat lblasc ]; } // extraMeta; -} +}) diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index a77206ae3852..86b09fa87768 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -131,6 +131,12 @@ let # * https://github.com/python/cpython/commit/e6b247c8e524 ../3.7/no-win64-workaround.patch + # fix openssl detection by reverting irrelevant change for us, to enable hashlib which is required by pip + (fetchpatch { + url = "https://github.com/ActiveState/cpython/pull/35/commits/20ea5b46aaf1e7bdf9d6905ba8bece2cc73b05b0.patch"; + revert = true; + hash = "sha256-Lp5fGlcfJJ6p6vKmcLckJiAA2AZz4prjFE0aMEJxotw="; + }) ] ++ lib.optionals (x11Support && stdenv.isDarwin) [ ./use-correct-tcl-tk-on-darwin.patch @@ -312,8 +318,6 @@ in with passthru; stdenv.mkDerivation ({ inherit passthru; postFixup = '' - # Include a sitecustomize.py file. Note it causes an error when it's in postInstall with 2.7. - cp ${../../sitecustomize.py} $out/${sitePackages}/sitecustomize.py '' + lib.optionalString strip2to3 '' rm -R $out/bin/2to3 $out/lib/python*/lib2to3 '' + lib.optionalString stripConfig '' diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 301af7a29c9e..96dcb6c25a13 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -537,8 +537,7 @@ in with passthru; stdenv.mkDerivation (finalAttrs: { # Strip tests rm -R $out/lib/python*/test $out/lib/python*/**/test{,s} '' + optionalString includeSiteCustomize '' - # Include a sitecustomize.py file - cp ${../sitecustomize.py} $out/${sitePackages}/sitecustomize.py + '' + optionalString stripBytecode '' # Determinism: deterministic bytecode # First we delete all old bytecode. diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 5d4ae2117146..a85a4231685f 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -35,9 +35,9 @@ in { major = "2"; minor = "7"; patch = "18"; - suffix = ".7"; # ActiveState's Python 2 extended support + suffix = ".8"; # ActiveState's Python 2 extended support }; - hash = "sha256-zcjAoSq6491ePiDySBCKrLIyYoO/5fdH6aBTNg/NH8s="; + hash = "sha256-HUOzu3uJbtd+3GbmGD35KOk/CDlwL4S7hi9jJGRFiqI="; inherit (darwin) configd; inherit passthruFun; }; diff --git a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh index 293bd5cebd50..16df00013925 100644 --- a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh @@ -77,13 +77,12 @@ _pythonRemoveDeps() { pythonRelaxDepsHook() { pushd dist - # See https://peps.python.org/pep-0491/#escaping-and-unicode - local -r pkg_name="${pname//[^[:alnum:].]/_}" local -r unpack_dir="unpacked" - local -r metadata_file="$unpack_dir/$pkg_name*/$pkg_name*.dist-info/METADATA" + local -r metadata_file="$unpack_dir/*/*.dist-info/METADATA" # We generally shouldn't have multiple wheel files, but let's be safer here - for wheel in "$pkg_name"*".whl"; do + for wheel in *".whl"; do + PYTHONPATH="@wheel@/@pythonSitePackages@:$PYTHONPATH" \ @pythonInterpreter@ -m wheel unpack --dest "$unpack_dir" "$wheel" rm -rf "$wheel" @@ -98,7 +97,7 @@ pythonRelaxDepsHook() { fi PYTHONPATH="@wheel@/@pythonSitePackages@:$PYTHONPATH" \ - @pythonInterpreter@ -m wheel pack "$unpack_dir/$pkg_name"* + @pythonInterpreter@ -m wheel pack "$unpack_dir/"* done # Remove the folder since it will otherwise be in the dist output. diff --git a/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py b/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py index 5a3a91939175..36ce389de50f 100644 --- a/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py +++ b/pkgs/development/interpreters/python/hooks/python-runtime-deps-check-hook.py @@ -78,7 +78,7 @@ def test_requirement(requirement: Requirement) -> bool: error(f"{package_name} not installed") return False - if package.version not in requirement.specifier: + if requirement.specifier and package.version not in requirement.specifier: error( f"{package_name}{requirement.specifier} not satisfied by version {package.version}" ) @@ -91,7 +91,12 @@ if __name__ == "__main__": args = argparser.parse_args() metadata = get_metadata(args.wheel) - tests = [test_requirement(requirement) for requirement in metadata.requires_dist] + requirements = metadata.requires_dist + + if not requirements: + sys.exit(0) + + tests = [test_requirement(requirement) for requirement in requirements] if not all(tests): sys.exit(1) diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index 9b414944bba5..5724f4944d9c 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -126,9 +126,6 @@ in with passthru; stdenv.mkDerivation rec { ln -s $out/${executable}-c/include $out/include/${libPrefix} ln -s $out/${executable}-c/lib-python/${if isPy3k then "3" else pythonVersion} $out/lib/${libPrefix} - # Include a sitecustomize.py file - cp ${../sitecustomize.py} $out/${if isPy38OrNewer then sitePackages else "lib/${libPrefix}/${sitePackages}"}/sitecustomize.py - runHook postInstall ''; diff --git a/pkgs/development/interpreters/python/pypy/prebuilt.nix b/pkgs/development/interpreters/python/pypy/prebuilt.nix index 4b47c642eca4..70f8711ef086 100644 --- a/pkgs/development/interpreters/python/pypy/prebuilt.nix +++ b/pkgs/development/interpreters/python/pypy/prebuilt.nix @@ -95,9 +95,6 @@ in with passthru; stdenv.mkDerivation { echo "Removing bytecode" find . -name "__pycache__" -type d -depth -delete - # Include a sitecustomize.py file - cp ${../sitecustomize.py} $out/${sitePackages}/sitecustomize.py - runHook postInstall ''; diff --git a/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix b/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix index 37a06f9f61ed..f0b60c2333f5 100644 --- a/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix +++ b/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix @@ -96,9 +96,6 @@ in with passthru; stdenv.mkDerivation { echo "Removing bytecode" find . -name "__pycache__" -type d -depth -delete - # Include a sitecustomize.py file - cp ${../sitecustomize.py} $out/${sitePackages}/sitecustomize.py - runHook postInstall ''; diff --git a/pkgs/development/interpreters/python/sitecustomize.py b/pkgs/development/interpreters/python/sitecustomize.py deleted file mode 100644 index d79a4696d8ea..000000000000 --- a/pkgs/development/interpreters/python/sitecustomize.py +++ /dev/null @@ -1,39 +0,0 @@ -""" -This is a Nix-specific module for discovering modules built with Nix. - -The module recursively adds paths that are on `NIX_PYTHONPATH` to `sys.path`. In -order to process possible `.pth` files `site.addsitedir` is used. - -The paths listed in `PYTHONPATH` are added to `sys.path` afterwards, but they -will be added before the entries we add here and thus take precedence. - -Note the `NIX_PYTHONPATH` environment variable is unset in order to prevent leakage. - -Similarly, this module listens to the environment variable `NIX_PYTHONEXECUTABLE` -and sets `sys.executable` to its value. -""" -import site -import sys -import os -import functools - -paths = os.environ.pop('NIX_PYTHONPATH', None) -if paths: - functools.reduce(lambda k, p: site.addsitedir(p, k), paths.split(':'), site._init_pathinfo()) - -# Check whether we are in a venv or virtualenv. -# For Python 3 we check whether our `base_prefix` is different from our current `prefix`. -# For Python 2 we check whether the non-standard `real_prefix` is set. -# https://stackoverflow.com/questions/1871549/determine-if-python-is-running-inside-virtualenv -in_venv = (sys.version_info.major == 3 and sys.prefix != sys.base_prefix) or (sys.version_info.major == 2 and hasattr(sys, "real_prefix")) - -if not in_venv: - executable = os.environ.pop('NIX_PYTHONEXECUTABLE', None) - prefix = os.environ.pop('NIX_PYTHONPREFIX', None) - - if 'PYTHONEXECUTABLE' not in os.environ and executable is not None: - sys.executable = executable - if prefix is not None: - # Sysconfig does not like it when sys.prefix is set to None - sys.prefix = sys.exec_prefix = prefix - site.PREFIXES.insert(0, prefix) diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix index df4484f9ec68..0251a903a7ae 100644 --- a/pkgs/development/interpreters/python/tests.nix +++ b/pkgs/development/interpreters/python/tests.nix @@ -39,11 +39,21 @@ let is_virtualenv = "False"; }; } // lib.optionalAttrs (!python.isPyPy) { - # Use virtualenv from a Nix env. - nixenv-virtualenv = rec { - env = runCommand "${python.name}-virtualenv" {} '' - ${pythonVirtualEnv.interpreter} -m virtualenv venv - mv venv $out + # Use virtualenv with symlinks from a Nix env. + nixenv-virtualenv-links = rec { + env = runCommand "${python.name}-virtualenv-links" {} '' + ${pythonVirtualEnv.interpreter} -m virtualenv --system-site-packages --symlinks --no-seed $out + ''; + interpreter = "${env}/bin/${python.executable}"; + is_venv = "False"; + is_nixenv = "True"; + is_virtualenv = "True"; + }; + } // lib.optionalAttrs (!python.isPyPy) { + # Use virtualenv with copies from a Nix env. + nixenv-virtualenv-copies = rec { + env = runCommand "${python.name}-virtualenv-copies" {} '' + ${pythonVirtualEnv.interpreter} -m virtualenv --system-site-packages --copies --no-seed $out ''; interpreter = "${env}/bin/${python.executable}"; is_venv = "False"; @@ -59,27 +69,48 @@ let is_nixenv = "True"; is_virtualenv = "False"; }; - } // lib.optionalAttrs (python.isPy3k && (!python.isPyPy)) { - # Venv built using plain Python + } // lib.optionalAttrs (python.pythonAtLeast "3.8" && (!python.isPyPy)) { + # Venv built using links to plain Python # Python 2 does not support venv # TODO: PyPy executable name is incorrect, it should be pypy-c or pypy-3c instead of pypy and pypy3. - plain-venv = rec { - env = runCommand "${python.name}-venv" {} '' - ${python.interpreter} -m venv $out + plain-venv-links = rec { + env = runCommand "${python.name}-venv-links" {} '' + ${python.interpreter} -m venv --system-site-packages --symlinks --without-pip $out + ''; + interpreter = "${env}/bin/${python.executable}"; + is_venv = "True"; + is_nixenv = "False"; + is_virtualenv = "False"; + }; + } // lib.optionalAttrs (python.pythonAtLeast "3.8" && (!python.isPyPy)) { + # Venv built using copies from plain Python + # Python 2 does not support venv + # TODO: PyPy executable name is incorrect, it should be pypy-c or pypy-3c instead of pypy and pypy3. + plain-venv-copies = rec { + env = runCommand "${python.name}-venv-copies" {} '' + ${python.interpreter} -m venv --system-site-packages --copies --without-pip $out ''; interpreter = "${env}/bin/${python.executable}"; is_venv = "True"; is_nixenv = "False"; is_virtualenv = "False"; }; - } // lib.optionalAttrs (python.pythonAtLeast "3.8") { # Venv built using Python Nix environment (python.buildEnv) - # TODO: Cannot create venv from a nix env - # Error: Command '['/nix/store/ddc8nqx73pda86ibvhzdmvdsqmwnbjf7-python3-3.7.6-venv/bin/python3.7', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. - nixenv-venv = rec { - env = runCommand "${python.name}-venv" {} '' - ${pythonEnv.interpreter} -m venv $out + nixenv-venv-links = rec { + env = runCommand "${python.name}-venv-links" {} '' + ${pythonEnv.interpreter} -m venv --system-site-packages --symlinks --without-pip $out + ''; + interpreter = "${env}/bin/${pythonEnv.executable}"; + is_venv = "True"; + is_nixenv = "True"; + is_virtualenv = "False"; + }; + } // lib.optionalAttrs (python.pythonAtLeast "3.8") { + # Venv built using Python Nix environment (python.buildEnv) + nixenv-venv-copies = rec { + env = runCommand "${python.name}-venv-copies" {} '' + ${pythonEnv.interpreter} -m venv --system-site-packages --copies --without-pip $out ''; interpreter = "${env}/bin/${pythonEnv.executable}"; is_venv = "True"; @@ -91,11 +122,33 @@ let testfun = name: attrs: runCommand "${python.name}-tests-${name}" ({ inherit (python) pythonVersion; } // attrs) '' + mkdir $out + + # set up the test files cp -r ${./tests/test_environments} tests chmod -R +w tests substituteAllInPlace tests/test_python.py - ${attrs.interpreter} -m unittest discover --verbose tests #/test_python.py - mkdir $out + + # run the tests by invoking the interpreter via full path + echo "absolute path: ${attrs.interpreter}" + ${attrs.interpreter} -m unittest discover --verbose tests 2>&1 | tee "$out/full.txt" + + # run the tests by invoking the interpreter via $PATH + export PATH="$(dirname ${attrs.interpreter}):$PATH" + echo "PATH: $(basename ${attrs.interpreter})" + "$(basename ${attrs.interpreter})" -m unittest discover --verbose tests 2>&1 | tee "$out/path.txt" + + # make sure we get the right path when invoking through a result link + ln -s "${attrs.env}" result + relative="result/bin/$(basename ${attrs.interpreter})" + expected="$PWD/$relative" + actual="$(./$relative -c "import sys; print(sys.executable)" | tee "$out/result.txt")" + if [ "$actual" != "$expected" ]; then + echo "expected $expected, got $actual" + exit 1 + fi + + # if we got this far, the tests passed touch $out/success ''; diff --git a/pkgs/development/interpreters/python/tests/test_environments/test_python.py b/pkgs/development/interpreters/python/tests/test_environments/test_python.py index 0fc4b8a9e91c..538273f65dbc 100644 --- a/pkgs/development/interpreters/python/tests/test_environments/test_python.py +++ b/pkgs/development/interpreters/python/tests/test_environments/test_python.py @@ -38,7 +38,7 @@ class TestCasePython(unittest.TestCase): @unittest.skipIf(IS_PYPY or sys.version_info.major==2, "Python 2 does not have base_prefix") def test_base_prefix(self): - if IS_VENV or IS_NIXENV or IS_VIRTUALENV: + if IS_VENV or IS_VIRTUALENV: self.assertNotEqual(sys.prefix, sys.base_prefix) else: self.assertEqual(sys.prefix, sys.base_prefix) diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix index f5f9b03e0fd3..aa568a01b1b0 100644 --- a/pkgs/development/interpreters/python/wrapper.nix +++ b/pkgs/development/interpreters/python/wrapper.nix @@ -35,6 +35,8 @@ let fi mkdir -p "$out/bin" + rm -f $out/bin/.*-wrapped + for path in ${lib.concatStringsSep " " paths}; do if [ -d "$path/bin" ]; then cd "$path/bin" @@ -42,7 +44,13 @@ let if [ -f "$prg" ]; then rm -f "$out/bin/$prg" if [ -x "$prg" ]; then - makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONPREFIX "$out" --set NIX_PYTHONEXECUTABLE ${pythonExecutable} --set NIX_PYTHONPATH ${pythonPath} ${lib.optionalString (!permitUserSite) ''--set PYTHONNOUSERSITE "true"''} ${lib.concatStringsSep " " makeWrapperArgs} + if [ -f ".$prg-wrapped" ]; then + echo "#!${pythonExecutable}" > "$out/bin/$prg" + sed -e '1d' -e '3d' ".$prg-wrapped" >> "$out/bin/$prg" + chmod +x "$out/bin/$prg" + else + makeWrapper "$path/bin/$prg" "$out/bin/$prg" --inherit-argv0 --resolve-argv0 ${lib.optionalString (!permitUserSite) ''--set PYTHONNOUSERSITE "true"''} ${lib.concatStringsSep " " makeWrapperArgs} + fi fi fi done diff --git a/pkgs/development/libraries/SDL/setup-hook.sh b/pkgs/development/libraries/SDL/setup-hook.sh index 553e8553a77f..54a9b3e8bfab 100644 --- a/pkgs/development/libraries/SDL/setup-hook.sh +++ b/pkgs/development/libraries/SDL/setup-hook.sh @@ -1,9 +1,15 @@ addSDLPath () { if [ -e "$1/include/SDL" ]; then export SDL_PATH="${SDL_PATH-}${SDL_PATH:+ }$1/include/SDL" - fi - if [ -e "$1/lib" ]; then - export SDL_LIB_PATH="${SDL_LIB_PATH-}${SDL_LIB_PATH:+ }-L$1/lib" + # NB this doesn’t work with split dev packages because different packages + # will contain "include/SDL/" and "lib/" directories. + # + # However the SDL_LIB_PATH is consumed by SDL itself and serves to locate + # libraries like SDL_mixer, SDL_image, etc which are not split-package + # so the check above will only trigger on them. + if [ -e "$1/lib" ]; then + export SDL_LIB_PATH="${SDL_LIB_PATH-}${SDL_LIB_PATH:+ }-L$1/lib" + fi fi } diff --git a/pkgs/development/libraries/Xaw3d/default.nix b/pkgs/development/libraries/Xaw3d/default.nix index f90be3a751e3..83237060312f 100644 --- a/pkgs/development/libraries/Xaw3d/default.nix +++ b/pkgs/development/libraries/Xaw3d/default.nix @@ -16,11 +16,11 @@ stdenv.mkDerivation rec { pname = "Xaw3d"; - version = "1.6.5"; + version = "1.6.6"; src = fetchurl { url = "https://www.x.org/releases/individual/lib/libXaw3d-${version}.tar.xz"; - sha256 = "sha256-NIHuS2dTuI4YhW6iZcuE8rAznujDu+yWaxVrOLWEGDM="; + sha256 = "sha256-pBw+NxNa1hax8ou95wACr788tZow3zQUH4KdMurchkY="; }; dontUseImakeConfigure = true; nativeBuildInputs = [ pkg-config bison flex imake gccmakedep ]; diff --git a/pkgs/development/libraries/at-spi2-core/default.nix b/pkgs/development/libraries/at-spi2-core/default.nix index 6ebab7eb4760..270f624965f6 100644 --- a/pkgs/development/libraries/at-spi2-core/default.nix +++ b/pkgs/development/libraries/at-spi2-core/default.nix @@ -23,14 +23,14 @@ stdenv.mkDerivation rec { pname = "at-spi2-core"; - version = "2.50.1"; + version = "2.50.2"; outputs = [ "out" "dev" ]; separateDebugInfo = true; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "Vye1wGh6xXuoBA55vWcxtxSja4/PMhkPI2uPs2mHiec="; + hash = "sha256-W4GxRhpi3Y++0aJ2+p71txEvmuX/huHjKtlkS2VP94w="; }; nativeBuildInputs = [ diff --git a/pkgs/development/libraries/dav1d/default.nix b/pkgs/development/libraries/dav1d/default.nix index 09b15ad4da78..da1eecdabab3 100644 --- a/pkgs/development/libraries/dav1d/default.nix +++ b/pkgs/development/libraries/dav1d/default.nix @@ -26,13 +26,13 @@ assert useVulkan -> withExamples; stdenv.mkDerivation rec { pname = "dav1d"; - version = "1.4.0"; + version = "1.4.1"; src = fetchFromGitHub { owner = "videolan"; repo = pname; rev = version; - hash = "sha256-NDv4ZlmrbRoecd0qj/sy+camn4uRTrvte4/84L6oUUg="; + hash = "sha256-PBFQrGGP7hKNMuwkl7q/7/C7v41xqdOYW+pJ70fI4Uo="; }; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/libraries/edencommon/default.nix b/pkgs/development/libraries/edencommon/default.nix index 68d6e5529157..0690f0f12ebd 100644 --- a/pkgs/development/libraries/edencommon/default.nix +++ b/pkgs/development/libraries/edencommon/default.nix @@ -11,13 +11,13 @@ stdenv.mkDerivation rec { pname = "edencommon"; - version = "2024.01.22.00"; + version = "2024.03.11.00"; src = fetchFromGitHub { owner = "facebookexperimental"; repo = "edencommon"; rev = "v${version}"; - sha256 = "sha256-KY0vXptzOEJLDjHvGd3T5oiCCvggND2bPBzvll+YBo4="; + sha256 = "sha256-1z4QicS98juv4bUEbHBkCjVJHEhnoJyLYp4zMHmDbMg="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/expat/2.6.0-fix-tests-flakiness.patch b/pkgs/development/libraries/expat/2.6.0-fix-tests-flakiness.patch deleted file mode 100644 index 9817b1833627..000000000000 --- a/pkgs/development/libraries/expat/2.6.0-fix-tests-flakiness.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff --git a/lib/internal.h b/lib/internal.h -index cce71e4c..a217b3f9 100644 ---- a/lib/internal.h -+++ b/lib/internal.h -@@ -31,7 +31,7 @@ - Copyright (c) 2016-2023 Sebastian Pipping - Copyright (c) 2018 Yury Gribov - Copyright (c) 2019 David Loffredo -- Copyright (c) 2023 Sony Corporation / Snild Dolkow -+ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow - Licensed under the MIT license: - - Permission is hereby granted, free of charge, to any person obtaining -@@ -162,7 +162,7 @@ const char *unsignedCharToPrintable(unsigned char c); - #endif - - extern XML_Bool g_reparseDeferralEnabledDefault; // written ONLY in runtests.c --extern unsigned int g_parseAttempts; // used for testing only -+extern unsigned int g_bytesScanned; // used for testing only - - #ifdef __cplusplus - } -diff --git a/lib/xmlparse.c b/lib/xmlparse.c -index aaf0fa9c..6de99d99 100644 ---- a/lib/xmlparse.c -+++ b/lib/xmlparse.c -@@ -38,7 +38,7 @@ - Copyright (c) 2022 Jann Horn - Copyright (c) 2022 Sean McBride - Copyright (c) 2023 Owain Davies -- Copyright (c) 2023 Sony Corporation / Snild Dolkow -+ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow - Licensed under the MIT license: - - Permission is hereby granted, free of charge, to any person obtaining -@@ -630,7 +630,7 @@ static unsigned long getDebugLevel(const char *variableName, - : ((*((pool)->ptr)++ = c), 1)) - - XML_Bool g_reparseDeferralEnabledDefault = XML_TRUE; // write ONLY in runtests.c --unsigned int g_parseAttempts = 0; // used for testing only -+unsigned int g_bytesScanned = 0; // used for testing only - - struct XML_ParserStruct { - /* The first member must be m_userData so that the XML_GetUserData -@@ -1017,7 +1017,7 @@ callProcessor(XML_Parser parser, const char *start, const char *end, - return XML_ERROR_NONE; - } - } -- g_parseAttempts += 1; -+ g_bytesScanned += (unsigned)have_now; - const enum XML_Error ret = parser->m_processor(parser, start, end, endPtr); - if (ret == XML_ERROR_NONE) { - // if we consumed nothing, remember what we had on this parse attempt. -diff --git a/tests/basic_tests.c b/tests/basic_tests.c -index 7112a440..a9cc3861 100644 ---- a/tests/basic_tests.c -+++ b/tests/basic_tests.c -@@ -5202,13 +5202,7 @@ START_TEST(test_nested_entity_suspend) { - END_TEST - - /* Regression test for quadratic parsing on large tokens */ --START_TEST(test_big_tokens_take_linear_time) { -- const char *const too_slow_failure_message -- = "Compared to the baseline runtime of the first test, this test has a " -- "slowdown of more than . " -- "Please keep increasing the value by 1 until it reliably passes the " -- "test on your hardware and open a bug sharing that number with us. " -- "Thanks in advance!"; -+START_TEST(test_big_tokens_scale_linearly) { - const struct { - const char *pre; - const char *post; -@@ -5220,65 +5214,57 @@ START_TEST(test_big_tokens_take_linear_time) { - {"<", "/>"}, // big elem name, used to be O(N²) - }; - const int num_cases = sizeof(text) / sizeof(text[0]); -- // For the test we need a value that is: -- // (1) big enough that the test passes reliably (avoiding flaky tests), and -- // (2) small enough that the test actually catches regressions. -- const int max_slowdown = 15; - char aaaaaa[4096]; - const int fillsize = (int)sizeof(aaaaaa); - const int fillcount = 100; -+ const unsigned approx_bytes = fillsize * fillcount; // ignore pre/post. -+ const unsigned max_factor = 4; -+ const unsigned max_scanned = max_factor * approx_bytes; - - memset(aaaaaa, 'a', fillsize); - - if (! g_reparseDeferralEnabledDefault) { - return; // heuristic is disabled; we would get O(n^2) and fail. - } --#if ! defined(__linux__) -- if (CLOCKS_PER_SEC < 100000) { -- // Skip this test if clock() doesn't have reasonably good resolution. -- // This workaround is primarily targeting Windows and FreeBSD, since -- // XSI requires the value to be 1.000.000 (10x the condition here), and -- // we want to be very sure that at least one platform in CI can catch -- // regressions (through a failing test). -- return; -- } --#endif - -- clock_t baseline = 0; - for (int i = 0; i < num_cases; ++i) { - XML_Parser parser = XML_ParserCreate(NULL); - assert_true(parser != NULL); - enum XML_Status status; -- set_subtest("max_slowdown=%d text=\"%saaaaaa%s\"", max_slowdown, -- text[i].pre, text[i].post); -- const clock_t start = clock(); -+ set_subtest("text=\"%saaaaaa%s\"", text[i].pre, text[i].post); - - // parse the start text -+ g_bytesScanned = 0; - status = _XML_Parse_SINGLE_BYTES(parser, text[i].pre, - (int)strlen(text[i].pre), XML_FALSE); - if (status != XML_STATUS_OK) { - xml_failure(parser); - } -+ - // parse lots of 'a', failing the test early if it takes too long -+ unsigned past_max_count = 0; - for (int f = 0; f < fillcount; ++f) { - status = _XML_Parse_SINGLE_BYTES(parser, aaaaaa, fillsize, XML_FALSE); - if (status != XML_STATUS_OK) { - xml_failure(parser); - } -- // i == 0 means we're still calculating the baseline value -- if (i > 0) { -- const clock_t now = clock(); -- const clock_t clocks_so_far = now - start; -- const int slowdown = clocks_so_far / baseline; -- if (slowdown >= max_slowdown) { -- fprintf( -- stderr, -- "fill#%d: clocks_so_far=%d baseline=%d slowdown=%d max_slowdown=%d\n", -- f, (int)clocks_so_far, (int)baseline, slowdown, max_slowdown); -- fail(too_slow_failure_message); -- } -+ if (g_bytesScanned > max_scanned) { -+ // We're not done, and have already passed the limit -- the test will -+ // definitely fail. This block allows us to save time by failing early. -+ const unsigned pushed -+ = (unsigned)strlen(text[i].pre) + (f + 1) * fillsize; -+ fprintf( -+ stderr, -+ "after %d/%d loops: pushed=%u scanned=%u (factor ~%.2f) max_scanned: %u (factor ~%u)\n", -+ f + 1, fillcount, pushed, g_bytesScanned, -+ g_bytesScanned / (double)pushed, max_scanned, max_factor); -+ past_max_count++; -+ // We are failing, but allow a few log prints first. If we don't reach -+ // a count of five, the test will fail after the loop instead. -+ assert_true(past_max_count < 5); - } - } -+ - // parse the end text - status = _XML_Parse_SINGLE_BYTES(parser, text[i].post, - (int)strlen(text[i].post), XML_TRUE); -@@ -5286,18 +5272,14 @@ START_TEST(test_big_tokens_take_linear_time) { - xml_failure(parser); - } - -- // how long did it take in total? -- const clock_t end = clock(); -- const clock_t taken = end - start; -- if (i == 0) { -- assert_true(taken > 0); // just to make sure we don't div-by-0 later -- baseline = taken; -- } -- const int slowdown = taken / baseline; -- if (slowdown >= max_slowdown) { -- fprintf(stderr, "taken=%d baseline=%d slowdown=%d max_slowdown=%d\n", -- (int)taken, (int)baseline, slowdown, max_slowdown); -- fail(too_slow_failure_message); -+ assert_true(g_bytesScanned > approx_bytes); // or the counter isn't working -+ if (g_bytesScanned > max_scanned) { -+ fprintf( -+ stderr, -+ "after all input: scanned=%u (factor ~%.2f) max_scanned: %u (factor ~%u)\n", -+ g_bytesScanned, g_bytesScanned / (double)approx_bytes, max_scanned, -+ max_factor); -+ fail("scanned too many bytes"); - } - - XML_ParserFree(parser); -@@ -5774,19 +5756,17 @@ START_TEST(test_varying_buffer_fills) { - fillsize[2], fillsize[3]); - XML_Parser parser = XML_ParserCreate(NULL); - assert_true(parser != NULL); -- g_parseAttempts = 0; - - CharData storage; - CharData_Init(&storage); - XML_SetUserData(parser, &storage); - XML_SetStartElementHandler(parser, start_element_event_handler); - -+ g_bytesScanned = 0; - int worstcase_bytes = 0; // sum of (buffered bytes at each XML_Parse call) -- int scanned_bytes = 0; // sum of (buffered bytes at each actual parse) - int offset = 0; - while (*fillsize >= 0) { - assert_true(offset + *fillsize <= document_length); // or test is invalid -- const unsigned attempts_before = g_parseAttempts; - const enum XML_Status status - = XML_Parse(parser, &document[offset], *fillsize, XML_FALSE); - if (status != XML_STATUS_OK) { -@@ -5796,28 +5776,20 @@ START_TEST(test_varying_buffer_fills) { - fillsize++; - assert_true(offset <= INT_MAX - worstcase_bytes); // avoid overflow - worstcase_bytes += offset; // we might've tried to parse all pending bytes -- if (g_parseAttempts != attempts_before) { -- assert_true(g_parseAttempts == attempts_before + 1); // max 1/XML_Parse -- assert_true(offset <= INT_MAX - scanned_bytes); // avoid overflow -- scanned_bytes += offset; // we *did* try to parse all pending bytes -- } - } - assert_true(storage.count == 1); // the big token should've been parsed -- assert_true(scanned_bytes > 0); // test-the-test: does our counter work? -+ assert_true(g_bytesScanned > 0); // test-the-test: does our counter work? - if (g_reparseDeferralEnabledDefault) { - // heuristic is enabled; some XML_Parse calls may have deferred reparsing -- const int max_bytes_scanned = -*fillsize; -- if (scanned_bytes > max_bytes_scanned) { -+ const unsigned max_bytes_scanned = -*fillsize; -+ if (g_bytesScanned > max_bytes_scanned) { - fprintf(stderr, -- "bytes scanned in parse attempts: actual=%d limit=%d \n", -- scanned_bytes, max_bytes_scanned); -+ "bytes scanned in parse attempts: actual=%u limit=%u \n", -+ g_bytesScanned, max_bytes_scanned); - fail("too many bytes scanned in parse attempts"); - } -- assert_true(scanned_bytes <= worstcase_bytes); -- } else { -- // heuristic is disabled; every XML_Parse() will have reparsed -- assert_true(scanned_bytes == worstcase_bytes); - } -+ assert_true(g_bytesScanned <= (unsigned)worstcase_bytes); - - XML_ParserFree(parser); - } -@@ -6065,7 +6037,7 @@ make_basic_test_case(Suite *s) { - tcase_add_test__ifdef_xml_dtd(tc_basic, - test_pool_integrity_with_unfinished_attr); - tcase_add_test__if_xml_ge(tc_basic, test_nested_entity_suspend); -- tcase_add_test(tc_basic, test_big_tokens_take_linear_time); -+ tcase_add_test(tc_basic, test_big_tokens_scale_linearly); - tcase_add_test(tc_basic, test_set_reparse_deferral); - tcase_add_test(tc_basic, test_reparse_deferral_is_inherited); - tcase_add_test(tc_basic, test_set_reparse_deferral_on_null_parser); diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix index d2f4aa392cb1..9944277e946b 100644 --- a/pkgs/development/libraries/expat/default.nix +++ b/pkgs/development/libraries/expat/default.nix @@ -16,7 +16,7 @@ # files. let - version = "2.6.0"; + version = "2.6.2"; tag = "R_${lib.replaceStrings ["."] ["_"] version}"; in stdenv.mkDerivation (finalAttrs: { @@ -25,14 +25,9 @@ stdenv.mkDerivation (finalAttrs: { src = fetchurl { url = with finalAttrs; "https://github.com/libexpat/libexpat/releases/download/${tag}/${pname}-${version}.tar.xz"; - hash = "sha256-y19ajqIR4cq9Wb4KkzpS48Aswyboak04fY0hjn7kej4="; + hash = "sha256-7hS0xdiQixvsN62TdgfqsYPU2YBqCK3uRyw8MSHSc2Q="; }; - patches = [ - # Fix tests flakiness on some platforms (like aarch64-darwin), should be released in 2.6.1 - ./2.6.0-fix-tests-flakiness.patch - ]; - strictDeps = true; outputs = [ "out" "dev" ]; # TODO: fix referrers diff --git a/pkgs/development/libraries/fb303/default.nix b/pkgs/development/libraries/fb303/default.nix index d1de187ec2c4..6c50819ef146 100644 --- a/pkgs/development/libraries/fb303/default.nix +++ b/pkgs/development/libraries/fb303/default.nix @@ -15,13 +15,13 @@ stdenv.mkDerivation rec { pname = "fb303"; - version = "2024.01.22.00"; + version = "2024.03.11.00"; src = fetchFromGitHub { owner = "facebook"; repo = "fb303"; rev = "v${version}"; - sha256 = "sha256-EQpe0REGWUpYg+llsCo4x6vJ7UPdWXk3uPM3b8b9Uf0="; + sha256 = "sha256-Jtztb8CTqvRdRjUa3jaouP5PFAwoM4rKLIfgvOyXUIg="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/fbthrift/default.nix b/pkgs/development/libraries/fbthrift/default.nix index 373d01892203..5ac08f2c6cc3 100644 --- a/pkgs/development/libraries/fbthrift/default.nix +++ b/pkgs/development/libraries/fbthrift/default.nix @@ -23,13 +23,13 @@ stdenv.mkDerivation rec { pname = "fbthrift"; - version = "2024.01.22.00"; + version = "2024.03.11.00"; src = fetchFromGitHub { owner = "facebook"; repo = "fbthrift"; rev = "v${version}"; - sha256 = "sha256-vIYXX4NOs2JdhrAJKmIhf4+hQEXHue2Ok7e4cw6yups="; + sha256 = "sha256-iCiiKNDlfKm1Y4SGzcSP6o/OdiRRrj9UEawW6qpBpSY="; }; nativeBuildInputs = [ @@ -38,7 +38,9 @@ stdenv.mkDerivation rec { flex ]; - cmakeFlags = lib.optionals stdenv.isDarwin [ + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=${if stdenv.isDarwin then "OFF" else "ON"}" + ] ++ lib.optionals stdenv.isDarwin [ "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14" # For aligned allocation ]; diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 6dba78cad219..538c93ae3fda 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -101,6 +101,7 @@ , withVmaf ? withFullDeps && !stdenv.isAarch64 && lib.versionAtLeast version "5" # Netflix's VMAF (Video Multi-Method Assessment Fusion) , withVoAmrwbenc ? withFullDeps && withVersion3 # AMR-WB encoder , withVorbis ? withHeadlessDeps # Vorbis de/encoding, native encoder exists +, withVpl ? false # Hardware acceleration via intel libvpl , withVpx ? withHeadlessDeps && stdenv.buildPlatform == stdenv.hostPlatform # VP8 & VP9 de/encoding , withVulkan ? withSmallDeps && !stdenv.isDarwin , withWebp ? withFullDeps # WebP encoder @@ -147,7 +148,7 @@ * Program options */ , buildFfmpeg ? withHeadlessDeps # Build ffmpeg executable -, buildFfplay ? withFullDeps # Build ffplay executable +, buildFfplay ? withSmallDeps # Build ffplay executable , buildFfprobe ? withHeadlessDeps # Build ffprobe executable , buildQtFaststart ? withFullDeps # Build qt-faststart executable , withBin ? buildFfmpeg || buildFfplay || buildFfprobe || buildQtFaststart @@ -246,6 +247,7 @@ , libvdpau , libvmaf , libvorbis +, libvpl , libvpx , libwebp , libX11 @@ -328,6 +330,7 @@ assert withGPLv3 -> withGPL && withVersion3; * Build dependencies */ assert withPixelutils -> buildAvutil; +assert !(withMfx && withVpl); # incompatible features /* * Program dependencies */ @@ -561,6 +564,9 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withV4l2M2m "v4l2-m2m") (enableFeature withVaapi "vaapi") (enableFeature withVdpau "vdpau") + ] ++ optionals (versionAtLeast version "6.0") [ + (enableFeature withVpl "libvpl") + ] ++ [ (enableFeature withVidStab "libvidstab") # Actual min. version 2.0 (enableFeature withVmaf "libvmaf") (enableFeature withVoAmrwbenc "libvo-amrwbenc") @@ -676,6 +682,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withVmaf [ libvmaf ] ++ optionals withVoAmrwbenc [ vo-amrwbenc ] ++ optionals withVorbis [ libvorbis ] + ++ optionals withVpl [ libvpl ] ++ optionals withVpx [ libvpx ] ++ optionals withVulkan [ vulkan-headers vulkan-loader ] ++ optionals withWebp [ libwebp ] diff --git a/pkgs/development/libraries/fizz/default.nix b/pkgs/development/libraries/fizz/default.nix index 282400948769..5415dde6ca85 100644 --- a/pkgs/development/libraries/fizz/default.nix +++ b/pkgs/development/libraries/fizz/default.nix @@ -19,13 +19,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "fizz"; - version = "2024.01.22.00"; + version = "2024.03.11.00"; src = fetchFromGitHub { owner = "facebookincubator"; repo = "fizz"; rev = "refs/tags/v${finalAttrs.version}"; - hash = "sha256-17EELvRrWhUprxvm1Ur0FYNimvY1qgK0YH8ehxtLpxM="; + hash = "sha256-IHWotiVUjGOvebXy4rwsh8U8UMxTrF1VaqXzZMjojiM="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/folly/default.nix b/pkgs/development/libraries/folly/default.nix index eb0372a40aff..9dd6bbeaa55e 100644 --- a/pkgs/development/libraries/folly/default.nix +++ b/pkgs/development/libraries/folly/default.nix @@ -1,5 +1,6 @@ { lib , stdenv +, overrideSDK , fetchFromGitHub , boost , cmake @@ -26,13 +27,13 @@ stdenv.mkDerivation rec { pname = "folly"; - version = "2024.01.22.00"; + version = "2024.03.11.00"; src = fetchFromGitHub { owner = "facebook"; repo = "folly"; rev = "v${version}"; - sha256 = "sha256-+z1wuEOgr7CMHFnOn5gLm9mtVH7mVURLstOoDqzxKbk="; + sha256 = "sha256-INvWTw27fmVbKQIT9ebdRGMCOIzpc/NepRN2EnKLJx0="; }; nativeBuildInputs = [ @@ -72,6 +73,8 @@ stdenv.mkDerivation rec { # see https://github.com/NixOS/nixpkgs/issues/144170 "-DCMAKE_INSTALL_INCLUDEDIR=include" "-DCMAKE_INSTALL_LIBDIR=lib" + ] ++ lib.optional (stdenv.isDarwin && stdenv.isx86_64) [ + "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13" ]; # split outputs to reduce downstream closure sizes diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix index d646830c771f..39e17a894cb7 100644 --- a/pkgs/development/libraries/glib-networking/default.nix +++ b/pkgs/development/libraries/glib-networking/default.nix @@ -19,13 +19,13 @@ stdenv.mkDerivation rec { pname = "glib-networking"; - version = "2.78.0"; + version = "2.78.1"; outputs = [ "out" "installedTests" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "Uv5M6T99xRM0sQKJRZmFjSPIplrEoRELMJIFZdaNOro="; + sha256 = "5I8t27BJgyy7CSMFKcXkXayp8N8O2jJfgy9zeYWb8J8="; }; patches = [ @@ -35,6 +35,12 @@ stdenv.mkDerivation rec { }) ./installed-tests-path.patch + + # pkcs11 tests provide a relative path that gnutls of course isn't able to + # load, resulting in test failures + # https://gitlab.gnome.org/GNOME/glib-networking/-/blob/2.78.1/tls/tests/certificate.c#L926 + # https://gitlab.gnome.org/GNOME/glib-networking/-/blob/2.78.1/tls/tests/connection.c#L3380 + ./disable-pkcs11-tests.patch ]; strictDeps = true; diff --git a/pkgs/development/libraries/glib-networking/disable-pkcs11-tests.patch b/pkgs/development/libraries/glib-networking/disable-pkcs11-tests.patch new file mode 100644 index 000000000000..43a37878b56c --- /dev/null +++ b/pkgs/development/libraries/glib-networking/disable-pkcs11-tests.patch @@ -0,0 +1,13 @@ +diff --git a/meson.build b/meson.build +index 0b3b8c0..7f6ce09 100644 +--- a/meson.build ++++ b/meson.build +@@ -86,7 +86,7 @@ if gnutls_dep.found() + backends += ['gnutls'] + # test-specific, maybe move to tls/tests + if cc.has_function('gnutls_pkcs11_init', prefix: '#include ', dependencies: gnutls_dep) +- config_h.set10('HAVE_GNUTLS_PKCS11', true) ++ config_h.set10('HAVE_GNUTLS_PKCS11', false) + endif + endif + diff --git a/pkgs/development/libraries/glibc/0001-Revert-Remove-all-usage-of-BASH-or-BASH-in-installed.patch b/pkgs/development/libraries/glibc/0001-Revert-Remove-all-usage-of-BASH-or-BASH-in-installed.patch index b7658b59fb1e..100bf31c3b00 100644 --- a/pkgs/development/libraries/glibc/0001-Revert-Remove-all-usage-of-BASH-or-BASH-in-installed.patch +++ b/pkgs/development/libraries/glibc/0001-Revert-Remove-all-usage-of-BASH-or-BASH-in-installed.patch @@ -1,4 +1,4 @@ -From cdd0c4b168fe228de97778556cea5c0f936e0e79 Mon Sep 17 00:00:00 2001 +From e207c3dbcff1d3d09c60eec99b6fec2a698b01bd Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Fri, 22 Jul 2022 22:11:07 -0700 Subject: [PATCH] Revert "Remove all usage of @BASH@ or ${BASH} in installed @@ -22,10 +22,10 @@ Co-authored-by: Maximilian Bosch 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/debug/Makefile b/debug/Makefile -index 52f9a7852c..22e4ae5461 100644 +index 3903cc97a3..b041acca71 100644 --- a/debug/Makefile +++ b/debug/Makefile -@@ -265,8 +265,9 @@ $(objpfx)pcprofiledump: $(objpfx)pcprofiledump.o +@@ -343,8 +343,9 @@ $(objpfx)pcprofiledump: $(objpfx)pcprofiledump.o $(objpfx)xtrace: xtrace.sh rm -f $@.new @@ -38,20 +38,20 @@ index 52f9a7852c..22e4ae5461 100644 && rm -f $@ && mv $@.new $@ && chmod +x $@ diff --git a/debug/xtrace.sh b/debug/xtrace.sh -index 3d1f2af43a..eb2ba7ad4a 100755 +index 77ec1d84df..5614404a71 100755 --- a/debug/xtrace.sh +++ b/debug/xtrace.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#! @BASH@ - # Copyright (C) 1999-2023 Free Software Foundation, Inc. + # Copyright (C) 1999-2024 Free Software Foundation, Inc. # This file is part of the GNU C Library. diff --git a/elf/Makefile b/elf/Makefile -index 0d19964d42..ee8ee1cd41 100644 +index 5d78b659ce..a2145d7b64 100644 --- a/elf/Makefile +++ b/elf/Makefile -@@ -250,7 +250,8 @@ $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \ +@@ -249,7 +249,8 @@ $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \ $(common-objpfx)libc_nonshared.a $(objpfx)sotruss: sotruss.sh $(common-objpfx)config.make @@ -61,7 +61,7 @@ index 0d19964d42..ee8ee1cd41 100644 -e 's%@TEXTDOMAINDIR@%$(localedir)%g' \ -e 's%@PREFIX@%$(prefix)%g' \ -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ -@@ -1396,6 +1397,7 @@ ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \ +@@ -1392,6 +1393,7 @@ ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \ -e 's%@VERSION@%$(version)%g' \ -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \ @@ -70,30 +70,30 @@ index 0d19964d42..ee8ee1cd41 100644 ifeq ($(ldd-rewrite-script),no) diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in -index e45dec5894..e09428506e 100644 +index d6b640df66..46111670cd 100644 --- a/elf/ldd.bash.in +++ b/elf/ldd.bash.in @@ -1,4 +1,4 @@ -#!/bin/bash +#! @BASH@ - # Copyright (C) 1996-2023 Free Software Foundation, Inc. + # Copyright (C) 1996-2024 Free Software Foundation, Inc. # This file is part of the GNU C Library. diff --git a/elf/sotruss.sh b/elf/sotruss.sh -index 874a6bed3f..7cc154561e 100755 +index ac1a83984e..2bf17c518e 100755 --- a/elf/sotruss.sh +++ b/elf/sotruss.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#! @BASH@ - # Copyright (C) 2011-2023 Free Software Foundation, Inc. + # Copyright (C) 2011-2024 Free Software Foundation, Inc. # This file is part of the GNU C Library. diff --git a/malloc/Makefile b/malloc/Makefile -index dfb51d344c..574b5e9579 100644 +index c83ade5f10..8dd9174b79 100644 --- a/malloc/Makefile +++ b/malloc/Makefile -@@ -306,8 +306,9 @@ $(objpfx)mtrace: mtrace.pl +@@ -312,8 +312,9 @@ $(objpfx)mtrace: mtrace.pl $(objpfx)memusage: memusage.sh rm -f $@.new @@ -106,17 +106,17 @@ index dfb51d344c..574b5e9579 100644 && rm -f $@ && mv $@.new $@ && chmod +x $@ diff --git a/malloc/memusage.sh b/malloc/memusage.sh -index b1f5848b74..329e36ef8a 100755 +index d2d9d17ea8..2e7efc9049 100755 --- a/malloc/memusage.sh +++ b/malloc/memusage.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#! @BASH@ - # Copyright (C) 1999-2023 Free Software Foundation, Inc. + # Copyright (C) 1999-2024 Free Software Foundation, Inc. # This file is part of the GNU C Library. diff --git a/timezone/Makefile b/timezone/Makefile -index 0306c0bca9..de9bbcc815 100644 +index d7acb387ba..c8e203ea3a 100644 --- a/timezone/Makefile +++ b/timezone/Makefile @@ -132,7 +132,8 @@ $(testdata)/XT5: testdata/gen-XT5.sh @@ -130,5 +130,5 @@ index 0306c0bca9..de9bbcc815 100644 -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \ -- -2.38.4 +2.42.0 diff --git a/pkgs/development/libraries/glibc/2.38-master.patch.gz b/pkgs/development/libraries/glibc/2.38-master.patch.gz deleted file mode 100644 index a07e4f8e1d50..000000000000 Binary files a/pkgs/development/libraries/glibc/2.38-master.patch.gz and /dev/null differ diff --git a/pkgs/development/libraries/glibc/2.39-master.patch b/pkgs/development/libraries/glibc/2.39-master.patch new file mode 100644 index 000000000000..3e0815573f5e --- /dev/null +++ b/pkgs/development/libraries/glibc/2.39-master.patch @@ -0,0 +1,566 @@ +commit 6d1e3fb07b45e2e31e469b16cf21b24bccf8914c +Author: Andreas K. Hüttel +Date: Wed Jan 31 02:12:43 2024 +0100 + + Replace advisories directory + + Signed-off-by: Andreas K. Hüttel + +diff --git a/ADVISORIES b/ADVISORIES +new file mode 100644 +index 0000000000..d4e33f2df3 +--- /dev/null ++++ b/ADVISORIES +@@ -0,0 +1,2 @@ ++For the GNU C Library Security Advisories, see the git master branch: ++https://sourceware.org/git/?p=glibc.git;a=tree;f=advisories;hb=HEAD +diff --git a/advisories/GLIBC-SA-2023-0001 b/advisories/GLIBC-SA-2023-0001 +deleted file mode 100644 +index 3d19c91b6a..0000000000 +--- a/advisories/GLIBC-SA-2023-0001 ++++ /dev/null +@@ -1,14 +0,0 @@ +-printf: incorrect output for integers with thousands separator and width field +- +-When the printf family of functions is called with a format specifier +-that uses an (enable grouping) and a minimum width +-specifier, the resulting output could be larger than reasonably expected +-by a caller that computed a tight bound on the buffer size. The +-resulting larger than expected output could result in a buffer overflow +-in the printf family of functions. +- +-CVE-Id: CVE-2023-25139 +-Public-Date: 2023-02-02 +-Vulnerable-Commit: e88b9f0e5cc50cab57a299dc7efe1a4eb385161d (2.37) +-Fix-Commit: c980549cc6a1c03c23cc2fe3e7b0fe626a0364b0 (2.38) +-Fix-Commit: 07b9521fc6369d000216b96562ff7c0ed32a16c4 (2.37-4) +diff --git a/advisories/GLIBC-SA-2023-0002 b/advisories/GLIBC-SA-2023-0002 +deleted file mode 100644 +index 5122669a64..0000000000 +--- a/advisories/GLIBC-SA-2023-0002 ++++ /dev/null +@@ -1,15 +0,0 @@ +-getaddrinfo: Stack read overflow in no-aaaa mode +- +-If the system is configured in no-aaaa mode via /etc/resolv.conf, +-getaddrinfo is called for the AF_UNSPEC address family, and a DNS +-response is received over TCP that is larger than 2048 bytes, +-getaddrinfo may potentially disclose stack contents via the returned +-address data, or crash. +- +-CVE-Id: CVE-2023-4527 +-Public-Date: 2023-09-12 +-Vulnerable-Commit: f282cdbe7f436c75864e5640a409a10485e9abb2 (2.36) +-Fix-Commit: bd77dd7e73e3530203be1c52c8a29d08270cb25d (2.39) +-Fix-Commit: 4ea972b7edd7e36610e8cde18bf7a8149d7bac4f (2.36-113) +-Fix-Commit: b7529346025a130fee483d42178b5c118da971bb (2.37-38) +-Fix-Commit: b25508dd774b617f99419bdc3cf2ace4560cd2d6 (2.38-19) +diff --git a/advisories/GLIBC-SA-2023-0003 b/advisories/GLIBC-SA-2023-0003 +deleted file mode 100644 +index d3aef80348..0000000000 +--- a/advisories/GLIBC-SA-2023-0003 ++++ /dev/null +@@ -1,15 +0,0 @@ +-getaddrinfo: Potential use-after-free +- +-When an NSS plugin only implements the _gethostbyname2_r and +-_getcanonname_r callbacks, getaddrinfo could use memory that was freed +-during buffer resizing, potentially causing a crash or read or write to +-arbitrary memory. +- +-CVE-Id: CVE-2023-4806 +-Public-Date: 2023-09-12 +-Fix-Commit: 973fe93a5675c42798b2161c6f29c01b0e243994 (2.39) +-Fix-Commit: e09ee267c03e3150c2c9ba28625ab130705a485e (2.34-420) +-Fix-Commit: e3ccb230a961b4797510e6a1f5f21fd9021853e7 (2.35-270) +-Fix-Commit: a9728f798ec7f05454c95637ee6581afaa9b487d (2.36-115) +-Fix-Commit: 6529a7466c935f36e9006b854d6f4e1d4876f942 (2.37-39) +-Fix-Commit: 00ae4f10b504bc4564e9f22f00907093f1ab9338 (2.38-20) +diff --git a/advisories/GLIBC-SA-2023-0004 b/advisories/GLIBC-SA-2023-0004 +deleted file mode 100644 +index 5286a7aa54..0000000000 +--- a/advisories/GLIBC-SA-2023-0004 ++++ /dev/null +@@ -1,16 +0,0 @@ +-tunables: local privilege escalation through buffer overflow +- +-If a tunable of the form NAME=NAME=VAL is passed in the environment of a +-setuid program and NAME is valid, it may result in a buffer overflow, +-which could be exploited to achieve escalated privileges. This flaw was +-introduced in glibc 2.34. +- +-CVE-Id: CVE-2023-4911 +-Public-Date: 2023-10-03 +-Vulnerable-Commit: 2ed18c5b534d9e92fc006202a5af0df6b72e7aca (2.34) +-Fix-Commit: 1056e5b4c3f2d90ed2b4a55f96add28da2f4c8fa (2.39) +-Fix-Commit: dcc367f148bc92e7f3778a125f7a416b093964d9 (2.34-423) +-Fix-Commit: c84018a05aec80f5ee6f682db0da1130b0196aef (2.35-274) +-Fix-Commit: 22955ad85186ee05834e47e665056148ca07699c (2.36-118) +-Fix-Commit: b4e23c75aea756b4bddc4abcf27a1c6dca8b6bd3 (2.37-45) +-Fix-Commit: 750a45a783906a19591fb8ff6b7841470f1f5701 (2.38-27) +diff --git a/advisories/GLIBC-SA-2023-0005 b/advisories/GLIBC-SA-2023-0005 +deleted file mode 100644 +index cc4eb90b82..0000000000 +--- a/advisories/GLIBC-SA-2023-0005 ++++ /dev/null +@@ -1,18 +0,0 @@ +-getaddrinfo: DoS due to memory leak +- +-The fix for CVE-2023-4806 introduced a memory leak when an application +-calls getaddrinfo for AF_INET6 with AI_CANONNAME, AI_ALL and AI_V4MAPPED +-flags set. +- +-CVE-Id: CVE-2023-5156 +-Public-Date: 2023-09-25 +-Vulnerable-Commit: e09ee267c03e3150c2c9ba28625ab130705a485e (2.34-420) +-Vulnerable-Commit: e3ccb230a961b4797510e6a1f5f21fd9021853e7 (2.35-270) +-Vulnerable-Commit: a9728f798ec7f05454c95637ee6581afaa9b487d (2.36-115) +-Vulnerable-Commit: 6529a7466c935f36e9006b854d6f4e1d4876f942 (2.37-39) +-Vulnerable-Commit: 00ae4f10b504bc4564e9f22f00907093f1ab9338 (2.38-20) +-Fix-Commit: 8006457ab7e1cd556b919f477348a96fe88f2e49 (2.34-421) +-Fix-Commit: 17092c0311f954e6f3c010f73ce3a78c24ac279a (2.35-272) +-Fix-Commit: 856bac55f98dc840e7c27cfa82262b933385de90 (2.36-116) +-Fix-Commit: 4473d1b87d04b25cdd0e0354814eeaa421328268 (2.37-42) +-Fix-Commit: 5ee59ca371b99984232d7584fe2b1a758b4421d3 (2.38-24) +diff --git a/advisories/GLIBC-SA-2024-0001 b/advisories/GLIBC-SA-2024-0001 +deleted file mode 100644 +index 28931c75ae..0000000000 +--- a/advisories/GLIBC-SA-2024-0001 ++++ /dev/null +@@ -1,15 +0,0 @@ +-syslog: Heap buffer overflow in __vsyslog_internal +- +-__vsyslog_internal did not handle a case where printing a SYSLOG_HEADER +-containing a long program name failed to update the required buffer +-size, leading to the allocation and overflow of a too-small buffer on +-the heap. +- +-CVE-Id: CVE-2023-6246 +-Public-Date: 2024-01-30 +-Vulnerable-Commit: 52a5be0df411ef3ff45c10c7c308cb92993d15b1 (2.37) +-Fix-Commit: 6bd0e4efcc78f3c0115e5ea9739a1642807450da (2.39) +-Fix-Commit: 23514c72b780f3da097ecf33a793b7ba9c2070d2 (2.38-42) +-Fix-Commit: 97a4292aa4a2642e251472b878d0ec4c46a0e59a (2.37-57) +-Vulnerable-Commit: b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 (2.36-16) +-Fix-Commit: d1a83b6767f68b3cb5b4b4ea2617254acd040c82 (2.36-126) +diff --git a/advisories/GLIBC-SA-2024-0002 b/advisories/GLIBC-SA-2024-0002 +deleted file mode 100644 +index 940bfcf2fc..0000000000 +--- a/advisories/GLIBC-SA-2024-0002 ++++ /dev/null +@@ -1,15 +0,0 @@ +-syslog: Heap buffer overflow in __vsyslog_internal +- +-__vsyslog_internal used the return value of snprintf/vsnprintf to +-calculate buffer sizes for memory allocation. If these functions (for +-any reason) failed and returned -1, the resulting buffer would be too +-small to hold output. +- +-CVE-Id: CVE-2023-6779 +-Public-Date: 2024-01-30 +-Vulnerable-Commit: 52a5be0df411ef3ff45c10c7c308cb92993d15b1 (2.37) +-Fix-Commit: 7e5a0c286da33159d47d0122007aac016f3e02cd (2.39) +-Fix-Commit: d0338312aace5bbfef85e03055e1212dd0e49578 (2.38-43) +-Fix-Commit: 67062eccd9a65d7fda9976a56aeaaf6c25a80214 (2.37-58) +-Vulnerable-Commit: b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 (2.36-16) +-Fix-Commit: 2bc9d7c002bdac38b5c2a3f11b78e309d7765b83 (2.36-127) +diff --git a/advisories/GLIBC-SA-2024-0003 b/advisories/GLIBC-SA-2024-0003 +deleted file mode 100644 +index b43a5150ab..0000000000 +--- a/advisories/GLIBC-SA-2024-0003 ++++ /dev/null +@@ -1,13 +0,0 @@ +-syslog: Integer overflow in __vsyslog_internal +- +-__vsyslog_internal calculated a buffer size by adding two integers, but +-did not first check if the addition would overflow. +- +-CVE-Id: CVE-2023-6780 +-Public-Date: 2024-01-30 +-Vulnerable-Commit: 52a5be0df411ef3ff45c10c7c308cb92993d15b1 (2.37) +-Fix-Commit: ddf542da94caf97ff43cc2875c88749880b7259b (2.39) +-Fix-Commit: d37c2b20a4787463d192b32041c3406c2bd91de0 (2.38-44) +-Fix-Commit: 2b58cba076e912961ceaa5fa58588e4b10f791c0 (2.37-59) +-Vulnerable-Commit: b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 (2.36-16) +-Fix-Commit: b9b7d6a27aa0632f334352fa400771115b3c69b7 (2.36-128) +diff --git a/advisories/README b/advisories/README +deleted file mode 100644 +index 94e68b1350..0000000000 +--- a/advisories/README ++++ /dev/null +@@ -1,73 +0,0 @@ +-GNU C Library Security Advisory Format +-====================================== +- +-Security advisories in this directory follow a simple git commit log +-format, with a heading and free-format description augmented with tags +-to allow parsing key information. References to code changes are +-specific to the glibc repository and follow a specific format: +- +- Tag-name: (release-version) +- +-The indicates a specific commit in the repository. The +-release-version indicates the publicly consumable release in which this +-commit is known to exist. The release-version is derived from the +-git-describe format, (i.e. stripped out from glibc-2.34.NNN-gxxxx) and +-is of the form 2.34-NNN. If the -NNN suffix is absent, it means that +-the change is in that release tarball, otherwise the change is on the +-release/2.YY/master branch and not in any released tarball. +- +-The following tags are currently being used: +- +-CVE-Id: +-This is the CVE-Id assigned under the CVE Program +-(https://www.cve.org/). +- +-Public-Date: +-The date this issue became publicly known. +- +-Vulnerable-Commit: +-The commit that introduced this vulnerability. There could be multiple +-entries, one for each release branch in the glibc repository; the +-release-version portion of this tag should tell you which branch this is +-on. +- +-Fix-Commit: +-The commit that fixed this vulnerability. There could be multiple +-entries for each release branch in the glibc repository, indicating that +-all of those commits contributed to fixing that issue in each of those +-branches. +- +-Adding an Advisory +------------------- +- +-An advisory for a CVE needs to be added on the master branch in two steps: +- +-1. Add the text of the advisory without any Fix-Commit tags along with +- the fix for the CVE. Add the Vulnerable-Commit tag, if applicable. +- The advisories directory does not exist in release branches, so keep +- the advisory text commit distinct from the code changes, to ease +- backports. Ask for the GLIBC-SA advisory number from the security +- team. +- +-2. Finish all backports on release branches and then back on the msater +- branch, add all commit refs to the advisory using the Fix-Commit +- tags. Don't bother adding the release-version subscript since the +- next step will overwrite it. +- +-3. Run the process-advisories.sh script in the scripts directory on the +- advisory: +- +- scripts/process-advisories.sh update GLIBC-SA-YYYY-NNNN +- +- (replace YYYY-NNNN with the actual advisory number). +- +-4. Verify the updated advisory and push the result. +- +-Getting a NEWS snippet from advisories +--------------------------------------- +- +-Run: +- +- scripts/process-advisories.sh news +- +-and copy the content into the NEWS file. + +commit 63295e4fda1f6dab4bf7442706fe303bf283036c +Author: Adhemerval Zanella +Date: Mon Feb 5 16:10:24 2024 +0000 + + arm: Remove wrong ldr from _dl_start_user (BZ 31339) + + The commit 49d877a80b29d3002887b084eec6676d9f5fec18 (arm: Remove + _dl_skip_args usage) removed the _SKIP_ARGS literal, which was + previously loader to r4 on loader _start. However, the cleanup did not + remove the following 'ldr r4, [sl, r4]' on _dl_start_user, used to check + to skip the arguments after ld self-relocations. + + In my testing, the kernel initially set r4 to 0, which makes the + ldr instruction just read the _GLOBAL_OFFSET_TABLE_. However, since r4 + is a callee-saved register; a different runtime might not zero + initialize it and thus trigger an invalid memory access. + + Checked on arm-linux-gnu. + + Reported-by: Adrian Ratiu + Reviewed-by: Szabolcs Nagy + (cherry picked from commit 1e25112dc0cb2515d27d8d178b1ecce778a9d37a) + +diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h +index b857bbc868..dd1a0f6b6e 100644 +--- a/sysdeps/arm/dl-machine.h ++++ b/sysdeps/arm/dl-machine.h +@@ -139,7 +139,6 @@ _start:\n\ + _dl_start_user:\n\ + adr r6, .L_GET_GOT\n\ + add sl, sl, r6\n\ +- ldr r4, [sl, r4]\n\ + @ save the entry point in another register\n\ + mov r6, r0\n\ + @ get the original arg count\n\ + +commit 312e159626b67fe11f39e83e222cf4348a3962f3 +Author: Adhemerval Zanella +Date: Thu Feb 1 14:29:53 2024 -0300 + + mips: FIx clone3 implementation (BZ 31325) + + For o32 we need to setup a minimal stack frame to allow cprestore + on __thread_start_clone3 (which instruct the linker to save the + gp for PIC). Also, there is no guarantee by kABI that $8 will be + preserved after syscall execution, so we need to save it on the + provided stack. + + Checked on mipsel-linux-gnu. + + Reported-by: Khem Raj + Tested-by: Khem Raj + (cherry picked from commit bbd248ac0d75efdef8fe61ea69b1fb25fb95b6e7) + +diff --git a/sysdeps/unix/sysv/linux/mips/clone3.S b/sysdeps/unix/sysv/linux/mips/clone3.S +index e9fec2fa47..481b8ae963 100644 +--- a/sysdeps/unix/sysv/linux/mips/clone3.S ++++ b/sysdeps/unix/sysv/linux/mips/clone3.S +@@ -37,11 +37,6 @@ + + .text + .set nomips16 +-#if _MIPS_SIM == _ABIO32 +-# define EXTRA_LOCALS 1 +-#else +-# define EXTRA_LOCALS 0 +-#endif + #define FRAMESZ ((NARGSAVE*SZREG)+ALSZ)&ALMASK + GPOFF= FRAMESZ-(1*SZREG) + NESTED(__clone3, SZREG, sp) +@@ -68,8 +63,31 @@ NESTED(__clone3, SZREG, sp) + beqz a0, L(error) /* No NULL cl_args pointer. */ + beqz a2, L(error) /* No NULL function pointer. */ + ++#if _MIPS_SIM == _ABIO32 ++ /* Both stack and stack_size on clone_args are defined as uint64_t, and ++ there is no need to handle values larger than to 32 bits for o32. */ ++# if __BYTE_ORDER == __BIG_ENDIAN ++# define CL_STACKPOINTER_OFFSET 44 ++# define CL_STACKSIZE_OFFSET 52 ++# else ++# define CL_STACKPOINTER_OFFSET 40 ++# define CL_STACKSIZE_OFFSET 48 ++# endif ++ ++ /* For o32 we need to setup a minimal stack frame to allow cprestore ++ on __thread_start_clone3. Also there is no guarantee by kABI that ++ $8 will be preserved after syscall execution (so we need to save it ++ on the provided stack). */ ++ lw t0, CL_STACKPOINTER_OFFSET(a0) /* Load the stack pointer. */ ++ lw t1, CL_STACKSIZE_OFFSET(a0) /* Load the stack_size. */ ++ addiu t1, -32 /* Update the stack size. */ ++ addu t2, t1, t0 /* Calculate the thread stack. */ ++ sw a3, 0(t2) /* Save argument pointer. */ ++ sw t1, CL_STACKSIZE_OFFSET(a0) /* Save the new stack size. */ ++#else + move $8, a3 /* a3 is set to 0/1 for syscall success/error + while a4/$8 is returned unmodified. */ ++#endif + + /* Do the system call, the kernel expects: + v0: system call number +@@ -125,7 +143,11 @@ L(thread_start_clone3): + + /* Restore the arg for user's function. */ + move t9, a2 /* Function pointer. */ ++#if _MIPS_SIM == _ABIO32 ++ PTR_L a0, 0(sp) ++#else + move a0, $8 /* Argument pointer. */ ++#endif + + /* Call the user's function. */ + jal t9 + +commit d0724994de40934c552f1f68de89053848a44927 +Author: Xi Ruoyao +Date: Thu Feb 22 21:26:55 2024 +0100 + + math: Update mips64 ulps + + Signed-off-by: Andreas K. Hüttel + (cherry picked from commit e2a65ecc4b30a797df7dc6529f09b712aa256029) + +diff --git a/sysdeps/mips/mips64/libm-test-ulps b/sysdeps/mips/mips64/libm-test-ulps +index 78969745b2..933aba4735 100644 +--- a/sysdeps/mips/mips64/libm-test-ulps ++++ b/sysdeps/mips/mips64/libm-test-ulps +@@ -1066,17 +1066,17 @@ double: 1 + ldouble: 1 + + Function: "j0": +-double: 2 ++double: 3 + float: 9 + ldouble: 2 + + Function: "j0_downward": +-double: 5 ++double: 6 + float: 9 + ldouble: 9 + + Function: "j0_towardzero": +-double: 6 ++double: 7 + float: 9 + ldouble: 9 + +@@ -1146,6 +1146,7 @@ float: 6 + ldouble: 8 + + Function: "log": ++double: 1 + float: 1 + ldouble: 1 + + +commit e0910f1d3278f05439fb434ee528fc9be1b6bd5e +Author: Stefan Liebler +Date: Thu Feb 22 15:03:27 2024 +0100 + + S390: Do not clobber r7 in clone [BZ #31402] + + Starting with commit e57d8fc97b90127de4ed3e3a9cdf663667580935 + "S390: Always use svc 0" + clone clobbers the call-saved register r7 in error case: + function or stack is NULL. + + This patch restores the saved registers also in the error case. + Furthermore the existing test misc/tst-clone is extended to check + all error cases and that clone does not clobber registers in this + error case. + + (cherry picked from commit 02782fd12849b6673cb5c2728cb750e8ec295aa3) + +diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S +index 4c882ef2ee..a7a863242c 100644 +--- a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S ++++ b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S +@@ -53,6 +53,7 @@ ENTRY(__clone) + br %r14 + error: + lhi %r2,-EINVAL ++ lm %r6,%r7,24(%r15) /* Load registers. */ + j SYSCALL_ERROR_LABEL + PSEUDO_END (__clone) + +diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S +index 4eb104be71..c552a6b8de 100644 +--- a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S ++++ b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S +@@ -54,6 +54,7 @@ ENTRY(__clone) + br %r14 + error: + lghi %r2,-EINVAL ++ lmg %r6,%r7,48(%r15) /* Restore registers. */ + jg SYSCALL_ERROR_LABEL + PSEUDO_END (__clone) + +diff --git a/sysdeps/unix/sysv/linux/tst-clone.c b/sysdeps/unix/sysv/linux/tst-clone.c +index 470676ab2b..2bc7124983 100644 +--- a/sysdeps/unix/sysv/linux/tst-clone.c ++++ b/sysdeps/unix/sysv/linux/tst-clone.c +@@ -16,12 +16,16 @@ + License along with the GNU C Library; if not, see + . */ + +-/* BZ #2386 */ ++/* BZ #2386, BZ #31402 */ + #include + #include + #include + #include + #include ++#include /* For _STACK_GROWS_{UP,DOWN}. */ ++#include ++ ++volatile unsigned v = 0xdeadbeef; + + int child_fn(void *arg) + { +@@ -30,22 +34,67 @@ int child_fn(void *arg) + } + + static int +-do_test (void) ++__attribute__((noinline)) ++do_clone (int (*fn)(void *), void *stack) + { + int result; ++ unsigned int a = v; ++ unsigned int b = v; ++ unsigned int c = v; ++ unsigned int d = v; ++ unsigned int e = v; ++ unsigned int f = v; ++ unsigned int g = v; ++ unsigned int h = v; ++ unsigned int i = v; ++ unsigned int j = v; ++ unsigned int k = v; ++ unsigned int l = v; ++ unsigned int m = v; ++ unsigned int n = v; ++ unsigned int o = v; ++ ++ result = clone (fn, stack, 0, NULL); ++ ++ /* Check that clone does not clobber call-saved registers. */ ++ TEST_VERIFY (a == v && b == v && c == v && d == v && e == v && f == v ++ && g == v && h == v && i == v && j == v && k == v && l == v ++ && m == v && n == v && o == v); ++ ++ return result; ++} ++ ++static void ++__attribute__((noinline)) ++do_test_single (int (*fn)(void *), void *stack) ++{ ++ printf ("%s (fn=%p, stack=%p)\n", __FUNCTION__, fn, stack); ++ errno = 0; ++ ++ int result = do_clone (fn, stack); ++ ++ TEST_COMPARE (errno, EINVAL); ++ TEST_COMPARE (result, -1); ++} + +- result = clone (child_fn, NULL, 0, NULL); ++static int ++do_test (void) ++{ ++ char st[128 * 1024] __attribute__ ((aligned)); ++ void *stack = NULL; ++#if _STACK_GROWS_DOWN ++ stack = st + sizeof (st); ++#elif _STACK_GROWS_UP ++ stack = st; ++#else ++# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP" ++#endif + +- if (errno != EINVAL || result != -1) +- { +- printf ("FAIL: clone()=%d (wanted -1) errno=%d (wanted %d)\n", +- result, errno, EINVAL); +- return 1; +- } ++ do_test_single (child_fn, NULL); ++ do_test_single (NULL, stack); ++ do_test_single (NULL, NULL); + +- puts ("All OK"); + return 0; + } + +-#define TEST_FUNCTION do_test () +-#include "../test-skeleton.c" ++#include diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 826d1e9c8389..4d6fb5a54b39 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -36,16 +36,15 @@ , withLinuxHeaders ? false , profilingLibraries ? false , withGd ? false -, withLibcrypt ? false , extraBuildInputs ? [] , extraNativeBuildInputs ? [] , ... } @ args: let - version = "2.38"; - patchSuffix = "-44"; - sha256 = "sha256-+4KZiZiyspllRnvBtp0VLpwwfSzzAcnq+0VVt3DvP9I="; + version = "2.39"; + patchSuffix = "-5"; + sha256 = "sha256-93vUfPgXDFc2Wue/hmlsEYrbOxINMlnGTFAtPcHi2SY="; in assert withLinuxHeaders -> linuxHeaders != null; @@ -59,14 +58,14 @@ stdenv.mkDerivation ({ patches = [ /* No tarballs for stable upstream branch, only https://sourceware.org/git/glibc.git and using git would complicate bootstrapping. - $ git fetch --all -p && git checkout origin/release/2.38/master && git describe - glibc-2.38-44-gd37c2b20a4 - $ git show --minimal --reverse glibc-2.38.. | gzip -9n --rsyncable - > 2.38-master.patch.gz + $ git fetch --all -p && git checkout origin/release/2.39/master && git describe + glibc-2.39-5-ge0910f1d32 + $ git show --minimal --reverse glibc-2.39.. > 2.39-master.patch To compare the archive contents zdiff can be used. - $ zdiff -u 2.38-master.patch.gz ../nixpkgs/pkgs/development/libraries/glibc/2.38-master.patch.gz + $ diff -u 2.39-master.patch ../nixpkgs/pkgs/development/libraries/glibc/2.39-master.patch */ - ./2.38-master.patch.gz + ./2.39-master.patch /* Allow NixOS and Nix to handle the locale-archive. */ ./nix-locale-archive.patch @@ -96,11 +95,6 @@ stdenv.mkDerivation ({ & https://github.com/NixOS/nixpkgs/pull/188492#issuecomment-1233802991 */ ./reenable_DT_HASH.patch - - /* Retrieved from https://salsa.debian.org/glibc-team/glibc/-/commit/662dbc4f9287139a0d9c91df328a5ba6cc6abee1#0f3c6d67cb8cf5bb35c421c20f828fea97b68edf - Qualys advisory: https://www.qualys.com/2024/01/30/qsort.txt - */ - ./local-qsort-memory-corruption.patch ] /* NVCC does not support ARM intrinsics. Since is pulled in by almost every HPC piece of software, without this patch CUDA compilation on ARM @@ -177,8 +171,7 @@ stdenv.mkDerivation ({ # so the glibc does not depend on its compiler store path "libc_cv_as_needed=no" ] - ++ lib.optional withGd "--with-gd" - ++ lib.optional withLibcrypt "--enable-crypt"; + ++ lib.optional withGd "--with-gd"; makeFlags = (args.makeFlags or []) ++ [ "OBJCOPY=${stdenv.cc.targetPrefix}objcopy" diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index be3bee081e73..3f7331461fea 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -2,7 +2,6 @@ , withLinuxHeaders ? true , profilingLibraries ? false , withGd ? false -, withLibcrypt? false , pkgsBuildBuild , libgcc }: @@ -16,7 +15,7 @@ let in (callPackage ./common.nix { inherit stdenv; } { - inherit withLinuxHeaders withGd profilingLibraries withLibcrypt; + inherit withLinuxHeaders withGd profilingLibraries; pname = "glibc" + lib.optionalString withGd "-gd" + lib.optionalString (stdenv.cc.isGNU && libgcc==null) "-nolibgcc"; }).overrideAttrs(previousAttrs: { diff --git a/pkgs/development/libraries/glibc/local-qsort-memory-corruption.patch b/pkgs/development/libraries/glibc/local-qsort-memory-corruption.patch deleted file mode 100644 index f7e25c72a61c..000000000000 --- a/pkgs/development/libraries/glibc/local-qsort-memory-corruption.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -rup a/stdlib/qsort.c b/stdlib/qsort.c ---- a/stdlib/qsort.c 2023-07-31 10:54:16.000000000 -0700 -+++ b/stdlib/qsort.c 2024-01-15 09:08:25.596167959 -0800 -@@ -224,7 +224,8 @@ _quicksort (void *const pbase, size_t to - while ((run_ptr += size) <= end_ptr) - { - tmp_ptr = run_ptr - size; -- while ((*cmp) ((void *) run_ptr, (void *) tmp_ptr, arg) < 0) -+ while (tmp_ptr != base_ptr -+ && (*cmp) ((void *) run_ptr, (void *) tmp_ptr, arg) < 0) - tmp_ptr -= size; - - tmp_ptr += size; - diff --git a/pkgs/development/libraries/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix index 3bef1d935564..681a810f8898 100644 --- a/pkgs/development/libraries/gnutls/default.nix +++ b/pkgs/development/libraries/gnutls/default.nix @@ -1,7 +1,7 @@ -{ config -, lib +{ lib , stdenv , fetchurl +, fetchpatch2 , zlib , lzo , libtasn1 @@ -57,11 +57,11 @@ in stdenv.mkDerivation rec { pname = "gnutls"; - version = "3.8.3"; + version = "3.8.4"; src = fetchurl { url = "mirror://gnupg/gnutls/v${lib.versions.majorMinor version}/gnutls-${version}.tar.xz"; - hash = "sha256-90/FlUsn1Oxt+7Ed6ph4iLWxJCiaNwOvytoO5SD0Fz4="; + hash = "sha256-K+pOFUeU8/ABgPoqXFH+iwBax6Mc1YvUTN+n8268Ops="; }; outputs = [ "bin" "dev" "out" ] @@ -73,6 +73,15 @@ stdenv.mkDerivation rec { patches = [ ./nix-ssl-cert-file.patch + # Revert https://gitlab.com/gnutls/gnutls/-/merge_requests/1800 + # dlopen isn't as easy in NixPkgs, as noticed in tests broken by this. + # Without getting the libs into RPATH they won't be found. + (fetchpatch2 { + name = "revert-dlopen-compression.patch"; + url = "https://gitlab.com/gnutls/gnutls/-/commit/8584908d6b679cd4e7676de437117a793e18347c.diff"; + revert = true; + hash = "sha256-r/+Gmwqy0Yc1LHL/PdPLXlErUBC5JxquLzCBAN3LuRM="; + }) ]; # Skip some tests: @@ -112,7 +121,7 @@ stdenv.mkDerivation rec { ++ lib.optional (withP11-kit) p11-kit ++ lib.optional (tpmSupport && stdenv.isLinux) trousers; - nativeBuildInputs = [ perl pkg-config texinfo ] + nativeBuildInputs = [ perl pkg-config texinfo ] ++ [ autoconf automake ] ++ lib.optionals doCheck [ which nettools util-linux ]; propagatedBuildInputs = [ nettle ] diff --git a/pkgs/development/libraries/libhandy/default.nix b/pkgs/development/libraries/libhandy/default.nix index 28e698e2a83f..19dcb4248f9b 100644 --- a/pkgs/development/libraries/libhandy/default.nix +++ b/pkgs/development/libraries/libhandy/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { pname = "libhandy"; - version = "1.8.2"; + version = "1.8.3"; outputs = [ "out" @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "sha256-0RqizT5XCsbQ79ukbRcxR8EfRYJkV+kkwFmQuy4N+a0="; + sha256 = "sha256-BbSXIpBz/1V/ELMm4HTFBm+HQ6MC1IIKuXvLXNLasIc="; }; depsBuildBuild = [ diff --git a/pkgs/development/libraries/libnice/default.nix b/pkgs/development/libraries/libnice/default.nix index ade70284ba68..72419deaccb5 100644 --- a/pkgs/development/libraries/libnice/default.nix +++ b/pkgs/development/libraries/libnice/default.nix @@ -18,14 +18,14 @@ stdenv.mkDerivation rec { pname = "libnice"; - version = "0.1.21"; + version = "0.1.22"; outputs = [ "bin" "out" "dev" ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "https://libnice.freedesktop.org/releases/${pname}-${version}.tar.gz"; - hash = "sha256-cuc6Ks8g9ZCT4h1WAWBuQFhzUD6zXzRvpiHeI+mbOzk="; + hash = "sha256-pfckzwnq5QxBp1FxQdidpKYeyerKMtpKAHP67VQXrX4="; }; patches = [ diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix index 415f097f3318..f82cc8b4c108 100644 --- a/pkgs/development/libraries/librsvg/default.nix +++ b/pkgs/development/libraries/librsvg/default.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "librsvg"; - version = "2.57.1"; + version = "2.57.92"; outputs = [ "out" "dev" ] ++ lib.optionals withIntrospection [ "devdoc" @@ -50,13 +50,13 @@ stdenv.mkDerivation (finalAttrs: { src = fetchurl { url = "mirror://gnome/sources/librsvg/${lib.versions.majorMinor finalAttrs.version}/librsvg-${finalAttrs.version}.tar.xz"; - hash = "sha256-B0Zxo+1vvNZ8ripA5TkQf08JfKikqxqJTAXiUk/zQO8="; + hash = "sha256-Kiwwvqvzz91ApKbb7T+zPmd8ruXY8wR4gkm3Mee+OFI="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit (finalAttrs) src; name = "librsvg-deps-${finalAttrs.version}"; - hash = "sha256-zICI7sps5KYe8/yWXbCJv529KxGLjoyDOmpCgVAIsTs="; + hash = "sha256-yJf3V2dPwI+RcDH6Lh/AhUgaisdbTnzdAFt+SeNw9NY="; # TODO: move this to fetchCargoTarball dontConfigure = true; }; diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix index 80b5f411e663..a7360741fe84 100644 --- a/pkgs/development/libraries/libtiff/default.nix +++ b/pkgs/development/libraries/libtiff/default.nix @@ -7,6 +7,7 @@ , pkg-config , sphinx +, lerc , libdeflate , libjpeg , xz @@ -62,6 +63,10 @@ stdenv.mkDerivation (finalAttrs: { # sure cross-compilation works first! nativeBuildInputs = [ autoreconfHook pkg-config sphinx ]; + buildInputs = [ + lerc + ]; + # TODO: opengl support (bogus configure detection) propagatedBuildInputs = [ libdeflate diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix index f3d58613b25d..e9faec42cd31 100644 --- a/pkgs/development/libraries/libva/default.nix +++ b/pkgs/development/libraries/libva/default.nix @@ -14,13 +14,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "libva" + lib.optionalString minimal "-minimal"; - version = "2.20.0"; + version = "2.21.0"; src = fetchFromGitHub { owner = "intel"; repo = "libva"; rev = finalAttrs.version; - sha256 = "sha256-ENAsytjqvS8xHZyZLPih3bzBgQ1f/j+s3dWZs1GTWHs="; + sha256 = "sha256-X9H5nxbYFSMfxZMxs3iWwCgdrJ2FTVWW7tlgQek3WIg="; }; outputs = [ "dev" "out" ]; diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix index 78c5d09889aa..1cca2d9222db 100644 --- a/pkgs/development/libraries/libxml2/default.nix +++ b/pkgs/development/libraries/libxml2/default.nix @@ -23,19 +23,9 @@ , testers }: -let - # Newer versions fail with minimal python, probably because - # https://gitlab.gnome.org/GNOME/libxml2/-/commit/b706824b612adb2c8255819c9a55e78b52774a3c - # This case is encountered "temporarily" during stdenv bootstrapping on darwin. - # Beware that the old version has known security issues, so the final set shouldn't use it. - oldVer = python.pname == "python3-minimal"; -in - assert oldVer -> stdenv.isDarwin; # reduce likelihood of using old libxml2 unintentionally - -let -libxml = stdenv.mkDerivation (finalAttrs: rec { +stdenv.mkDerivation (finalAttrs: rec { pname = "libxml2"; - version = "2.12.5"; + version = "2.12.6"; outputs = [ "bin" "dev" "out" "doc" ] ++ lib.optional pythonSupport "py" @@ -44,7 +34,7 @@ libxml = stdenv.mkDerivation (finalAttrs: rec { src = fetchurl { url = "mirror://gnome/sources/libxml2/${lib.versions.majorMinor version}/libxml2-${version}.tar.xz"; - hash = "sha256-qXJ5Zpav04Bz4PWcKDw6L1pWC1JotLq8ORsoYWZSayE="; + hash = "sha256-iJxZOogaPbX92WzJMYyH3zTrZI7fxFgnKtRv1gc1P7s="; }; strictDeps = true; @@ -139,15 +129,4 @@ libxml = stdenv.mkDerivation (finalAttrs: rec { maintainers = with maintainers; [ eelco jtojnar ]; pkgConfigModules = [ "libxml-2.0" ]; }; -}); -in -if oldVer then - libxml.overrideAttrs (attrs: rec { - version = "2.10.1"; - src = fetchurl { - url = "mirror://gnome/sources/libxml2/${lib.versions.majorMinor version}/libxml2-${version}.tar.xz"; - sha256 = "21a9e13cc7c4717a6c36268d0924f92c3f67a1ece6b7ff9d588958a6db9fb9d8"; - }; - }) -else - libxml +}) diff --git a/pkgs/development/libraries/mvfst/default.nix b/pkgs/development/libraries/mvfst/default.nix index 6b6e2d9c9e57..45b432a2dc9e 100644 --- a/pkgs/development/libraries/mvfst/default.nix +++ b/pkgs/development/libraries/mvfst/default.nix @@ -12,13 +12,13 @@ stdenv.mkDerivation rec { pname = "mvfst"; - version = "2024.01.22.00"; + version = "2024.03.11.00"; src = fetchFromGitHub { owner = "facebook"; repo = "mvfst"; rev = "v${version}"; - sha256 = "sha256-vhLwxA91v+vt5PQejhPOaj9YSkulg86hTD9GkpQKB24="; + sha256 = "sha256-KjNTDgpiR9EG42Agl2JFJoPo5+8GlS27oPMWpdLq2v8="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/npth/default.nix b/pkgs/development/libraries/npth/default.nix index 023d9cebb973..f7a31ad8086f 100644 --- a/pkgs/development/libraries/npth/default.nix +++ b/pkgs/development/libraries/npth/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook }: stdenv.mkDerivation rec { pname = "npth"; @@ -9,6 +9,16 @@ stdenv.mkDerivation rec { sha256 = "sha256-hYn1aTe3XOM7KNMS/MvzArO3HsPzlF/eaqp0AnkUrQU="; }; + patches = [ + (fetchpatch { + name = "musl.patch"; + url = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=npth.git;a=patch;h=417abd56fd7bf45cd4948414050615cb1ad59134"; + hash = "sha256-0g2tLFjW1bybNi6oxlW7vPimsQLjmTih4JZSoATjESI="; + }) + ]; + + nativeBuildInputs = [ autoreconfHook ]; + doCheck = true; meta = with lib; { diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix index fc722257a9c1..34288773705a 100644 --- a/pkgs/development/libraries/pango/default.nix +++ b/pkgs/development/libraries/pango/default.nix @@ -24,13 +24,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "pango"; - version = "1.51.0"; + version = "1.51.2"; outputs = [ "bin" "out" "dev" ] ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = with finalAttrs; "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "dO/BCa5vkDu+avd+qirGCUuO4kWi4j8TKnqPCGLRqfU="; + sha256 = "sha256-PbpAfytfwRfhkvMCXwocyO3B/ZuTSxxXiyuXNCE5QVo="; }; depsBuildBuild = [ diff --git a/pkgs/development/libraries/s2n-tls/default.nix b/pkgs/development/libraries/s2n-tls/default.nix index a8c8a22ff1bb..1d50f1d89fa4 100644 --- a/pkgs/development/libraries/s2n-tls/default.nix +++ b/pkgs/development/libraries/s2n-tls/default.nix @@ -8,13 +8,13 @@ stdenv.mkDerivation rec { pname = "s2n-tls"; - version = "1.4.6"; + version = "1.4.8"; src = fetchFromGitHub { owner = "aws"; repo = pname; rev = "v${version}"; - hash = "sha256-x4/AkmkmuTKxzlk8AxbydA4GctpShsKiFTTJ8m7B4TY="; + hash = "sha256-fDofKp/WUPY4+1HUeBdRklInTS7Qndycnci4h3F/mLY="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/spirv-headers/default.nix b/pkgs/development/libraries/spirv-headers/default.nix index 64362243229b..655233362e15 100644 --- a/pkgs/development/libraries/spirv-headers/default.nix +++ b/pkgs/development/libraries/spirv-headers/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "spirv-headers"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "SPIRV-Headers"; rev = "vulkan-sdk-${version}"; - hash = "sha256-/I9dJlBE0kvFvqooKuqMETtOE72Jmva3zIGnq0o4+aE="; + hash = "sha256-kyOAwe4R0FmeA9IIJF2eoZR+7g9LiGKaZ7FuIfkrXJ4="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index 5152f5d0e33c..d172d75e011b 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -15,13 +15,13 @@ in stdenv.mkDerivation rec { pname = "sqlite${lib.optionalString interactive "-interactive"}"; - version = "3.45.1"; + version = "3.45.2"; # nixpkgs-update: no auto update # NB! Make sure to update ./tools.nix src (in the same directory). src = fetchurl { url = "https://sqlite.org/2024/sqlite-autoconf-${archiveVersion version}.tar.gz"; - hash = "sha256-zZwnhBt6WTLJiXZR4guGxwHddAVWmJsByllvz6PUmgo="; + hash = "sha256-vJBnRC7t8905mJtcXPv/83rmbMnJknTgwwUtxNSo9q4="; }; outputs = [ "bin" "dev" "out" ]; diff --git a/pkgs/development/libraries/sqlite/tools.nix b/pkgs/development/libraries/sqlite/tools.nix index 695d2207da7d..94ac07df9d40 100644 --- a/pkgs/development/libraries/sqlite/tools.nix +++ b/pkgs/development/libraries/sqlite/tools.nix @@ -4,12 +4,12 @@ let archiveVersion = import ./archive-version.nix lib; mkTool = { pname, makeTarget, description, homepage, mainProgram }: stdenv.mkDerivation rec { inherit pname; - version = "3.45.1"; + version = "3.45.2"; # nixpkgs-update: no auto update src = assert version == sqlite.version; fetchurl { url = "https://sqlite.org/2024/sqlite-src-${archiveVersion version}.zip"; - hash = "sha256-f3sUpo7bzUpX3zqMTb1W0tNUam583VDeQM6wOvM9NLo="; + hash = "sha256-SkWjV3zIr2g8S9TG6Bp8eCxbfV2qBhdeosuXHKcWkbE="; }; nativeBuildInputs = [ unzip ]; diff --git a/pkgs/development/libraries/umockdev/default.nix b/pkgs/development/libraries/umockdev/default.nix index 9c3026b0c9fb..1fe1c0b01d92 100644 --- a/pkgs/development/libraries/umockdev/default.nix +++ b/pkgs/development/libraries/umockdev/default.nix @@ -22,13 +22,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "umockdev"; - version = "0.17.18"; + version = "0.18.0"; outputs = [ "bin" "out" "dev" "devdoc" ]; src = fetchurl { url = "https://github.com/martinpitt/umockdev/releases/download/${finalAttrs.version}/umockdev-${finalAttrs.version}.tar.xz"; - sha256 = "sha256-RmrT4McV5W9Q6mqWUWWCPQc6hBN6y4oeObZlc2SKmF8="; + hash = "sha256-uJkeaKK89C6mCYjfqLzvAFUNmo6IvvZvn2mxp7H44ng="; }; patches = [ @@ -43,12 +43,6 @@ stdenv.mkDerivation (finalAttrs: { src = ./substitute-udevadm.patch; udevadm = "${systemdMinimal}/bin/udevadm"; }) - - (fetchpatch { - name = "musl.patch"; - url = "https://github.com/martinpitt/umockdev/commit/d4efe24be59bd859b87473ea3d7efe8100bedc74.patch"; - hash = "sha256-whf3p2e7FWN1xk5+HF9KsbMW74DPOQ0R0+FxBfCZTX0="; - }) ]; nativeBuildInputs = [ diff --git a/pkgs/development/libraries/vulkan-headers/default.nix b/pkgs/development/libraries/vulkan-headers/default.nix index dc17404c8480..5793905a75a1 100644 --- a/pkgs/development/libraries/vulkan-headers/default.nix +++ b/pkgs/development/libraries/vulkan-headers/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, cmake }: stdenv.mkDerivation rec { pname = "vulkan-headers"; - version = "1.3.275.0"; + version = "1.3.280.0"; nativeBuildInputs = [ cmake ]; @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { owner = "KhronosGroup"; repo = "Vulkan-Headers"; rev = "vulkan-sdk-${version}"; - hash = "sha256-kBOkj7mr4stPXUCBhNJpNL3A+9BebEwrIBEIroxdH8Y="; + hash = "sha256-EnKiCtH6rh3ACQgokSSfp4FPFluMZW0dheP8IEzZtY4="; }; passthru.updateScript = ./update.sh; diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix index 8b0f236acf4e..f36a01e1a67f 100644 --- a/pkgs/development/libraries/vulkan-loader/default.nix +++ b/pkgs/development/libraries/vulkan-loader/default.nix @@ -4,13 +4,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "vulkan-loader"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "Vulkan-Loader"; rev = "vulkan-sdk-${finalAttrs.version}"; - hash = "sha256-53PUXAWiK38ciV6oMvD7ZHdXi4RU4r0RmDWUUHU3mE0="; + hash = "sha256-zkJSPshRaZRDiBvLJbJo8l1MX10KXYZniqtNTNnokT4="; }; patches = [ ./fix-pkgconfig.patch ]; diff --git a/pkgs/development/libraries/vulkan-utility-libraries/default.nix b/pkgs/development/libraries/vulkan-utility-libraries/default.nix index 301311e12412..c2c49671b078 100644 --- a/pkgs/development/libraries/vulkan-utility-libraries/default.nix +++ b/pkgs/development/libraries/vulkan-utility-libraries/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "vulkan-utility-libraries"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "Vulkan-Utility-Libraries"; rev = "vulkan-sdk-${finalAttrs.version}"; - hash = "sha256-gvia+Xb9BpOjPARKo3Sgp85Bfh1roFZ2PzCtXVFYeIU="; + hash = "sha256-mCD9/bpWUXRVJ+OyOqG0tXTgFuptIlcG6UR/RiNV1Z0="; }; nativeBuildInputs = [ cmake python3 ]; diff --git a/pkgs/development/libraries/wangle/default.nix b/pkgs/development/libraries/wangle/default.nix index d30389d97259..080bfb4d018c 100644 --- a/pkgs/development/libraries/wangle/default.nix +++ b/pkgs/development/libraries/wangle/default.nix @@ -18,13 +18,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "wangle"; - version = "2024.01.22.00"; + version = "2024.03.11.00"; src = fetchFromGitHub { owner = "facebook"; repo = "wangle"; rev = "v${finalAttrs.version}"; - sha256 = "sha256-pXcJszncYWvtwT4guEl69rOAIXZzgF7I6qh8PqLbxdA="; + sha256 = "sha256-fDtJ+9bZj+siKlMglYMkLO/+jldUmsS5V3Umk1gNdlo="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/wayland/protocols.nix b/pkgs/development/libraries/wayland/protocols.nix index 9625f3a5ee1b..e150c87c15d1 100644 --- a/pkgs/development/libraries/wayland/protocols.nix +++ b/pkgs/development/libraries/wayland/protocols.nix @@ -6,14 +6,14 @@ stdenv.mkDerivation rec { pname = "wayland-protocols"; - version = "1.33"; + version = "1.34"; # https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/48 doCheck = stdenv.hostPlatform == stdenv.buildPlatform && stdenv.hostPlatform.linker == "bfd" && wayland.withLibraries; src = fetchurl { url = "https://gitlab.freedesktop.org/wayland/${pname}/-/releases/${version}/downloads/${pname}-${version}.tar.xz"; - hash = "sha256-lPDFCwkNbmGgP2IEhGexmrvoUb5OEa57NvZfi5jDljo="; + hash = "sha256-xZsnys2F9guvTuX4DfXA0Vdg6taiQysAq34uBXTcr+s="; }; postPatch = lib.optionalString doCheck '' diff --git a/pkgs/development/python-modules/django/4.nix b/pkgs/development/python-modules/django/4.nix index 4340c5ab2c97..029db650ab86 100644 --- a/pkgs/development/python-modules/django/4.nix +++ b/pkgs/development/python-modules/django/4.nix @@ -41,14 +41,15 @@ }: buildPythonPackage rec { - pname = "Django"; + pname = "django"; version = "4.2.11"; format = "pyproject"; disabled = pythonOlder "3.8"; src = fetchPypi { - inherit pname version; + pname = "Django"; + inherit version; hash = "sha256-bm/z2y2N0MmGtO7IVUyOT5GbXB/2KltDkMF6/y7W5cQ="; }; diff --git a/pkgs/development/python-modules/packaging/default.nix b/pkgs/development/python-modules/packaging/default.nix index 123c1230fc87..32ce7fd8accb 100644 --- a/pkgs/development/python-modules/packaging/default.nix +++ b/pkgs/development/python-modules/packaging/default.nix @@ -14,14 +14,14 @@ let packaging = buildPythonPackage rec { pname = "packaging"; - version = "23.2"; + version = "24.0"; pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-BI+w6UBQNlGOqvSKVZU8dQwR4aG2jg3RqdYu0MCSz8U="; + hash = "sha256-64LF4+ViCQdHZuaIW7BLjDigwBXQowA26+fs40yZiek="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/pymysql/default.nix b/pkgs/development/python-modules/pymysql/default.nix index 888b5b9d309c..e7711f5902b9 100644 --- a/pkgs/development/python-modules/pymysql/default.nix +++ b/pkgs/development/python-modules/pymysql/default.nix @@ -5,11 +5,12 @@ }: buildPythonPackage rec { - pname = "PyMySQL"; + pname = "pymysql"; version = "1.0.2"; src = fetchPypi { - inherit pname version; + pname = "PyMySQL"; + inherit version; sha256 = "816927a350f38d56072aeca5dfb10221fe1dc653745853d30a216637f5d7ad36"; }; diff --git a/pkgs/development/python-modules/pyqrcode/default.nix b/pkgs/development/python-modules/pyqrcode/default.nix index 7cb0a94eb74a..2b0ce5193555 100644 --- a/pkgs/development/python-modules/pyqrcode/default.nix +++ b/pkgs/development/python-modules/pyqrcode/default.nix @@ -1,11 +1,12 @@ { lib, buildPythonPackage, fetchPypi }: buildPythonPackage rec { - pname = "PyQRCode"; + pname = "pyqrcode"; version = "1.2.1"; src = fetchPypi { - inherit pname version; + pname = "PyQRCode"; + inherit version; sha256 = "fdbf7634733e56b72e27f9bce46e4550b75a3a2c420414035cae9d9d26b234d5"; }; diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 0b2b1c8ad6b1..0af19e2c174e 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -26,14 +26,15 @@ }: buildPythonPackage rec { - pname = "PyQt5"; + pname = "pyqt5"; version = "5.15.9"; format = "pyproject"; disabled = isPy27; src = fetchPypi { - inherit pname version; + pname = "PyQt5"; + inherit version; hash = "sha256-3EHoQBqQ3D4raStBG9VJKrVZrieidCTu1L05FVZOxMA="; }; diff --git a/pkgs/development/python-modules/send2trash/default.nix b/pkgs/development/python-modules/send2trash/default.nix index 62bbea264e72..bd08e6c2dcde 100644 --- a/pkgs/development/python-modules/send2trash/default.nix +++ b/pkgs/development/python-modules/send2trash/default.nix @@ -6,7 +6,7 @@ }: buildPythonPackage rec { - pname = "Send2Trash"; + pname = "send2trash"; version = "1.8.2"; format = "pyproject"; diff --git a/pkgs/development/python-modules/sqlalchemy-i18n/default.nix b/pkgs/development/python-modules/sqlalchemy-i18n/default.nix index a17e7ada4522..a33a9783319f 100644 --- a/pkgs/development/python-modules/sqlalchemy-i18n/default.nix +++ b/pkgs/development/python-modules/sqlalchemy-i18n/default.nix @@ -7,11 +7,12 @@ }: buildPythonPackage rec { - pname = "SQLAlchemy-i18n"; + pname = "sqlalchemy-i18n"; version = "1.1.0"; src = fetchPypi { - inherit pname version; + pname = "SQLAlchemy-i18n"; + inherit version; sha256 = "de33376483a581ca14218d8f57a114466c5f72b674a95839b6c4564a6e67796f"; }; diff --git a/pkgs/development/python-modules/sqlalchemy/default.nix b/pkgs/development/python-modules/sqlalchemy/default.nix index 0d3ac845f608..ae1f22b4c2f6 100644 --- a/pkgs/development/python-modules/sqlalchemy/default.nix +++ b/pkgs/development/python-modules/sqlalchemy/default.nix @@ -39,8 +39,8 @@ }: buildPythonPackage rec { - pname = "SQLAlchemy"; - version = "2.0.28"; + pname = "sqlalchemy"; + version = "2.0.29"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -49,7 +49,7 @@ buildPythonPackage rec { owner = "sqlalchemy"; repo = "sqlalchemy"; rev = "refs/tags/rel_${lib.replaceStrings [ "." ] [ "_" ] version}"; - hash = "sha256-Xl3w9v97tyOpL4vUYzlovGrUGIZtIZsAhbE5/FhqFiM="; + hash = "sha256-jEkuvwq/KKjcsREWDvvTFT87kgu3TSBR3JaseOs54qc="; }; postPatch = '' diff --git a/pkgs/development/python-modules/ukpostcodeparser/default.nix b/pkgs/development/python-modules/ukpostcodeparser/default.nix index a2c452046ab9..486cee90435a 100644 --- a/pkgs/development/python-modules/ukpostcodeparser/default.nix +++ b/pkgs/development/python-modules/ukpostcodeparser/default.nix @@ -1,11 +1,12 @@ { lib, buildPythonPackage, fetchPypi }: buildPythonPackage rec { - pname = "UkPostcodeParser"; + pname = "ukpostcodeparser"; version = "1.1.2"; src = fetchPypi { - inherit pname version; + pname = "UkPostcodeParser"; + inherit version; sha256 = "930264efa293db80af0103a4fe9c161b06365598d24bb6fe5403f3f57c70530e"; }; diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix index 0533af678919..838dfff80fe3 100644 --- a/pkgs/development/tools/misc/elfutils/default.nix +++ b/pkgs/development/tools/misc/elfutils/default.nix @@ -8,11 +8,11 @@ # TODO: Look at the hardcoded paths to kernel, modules etc. stdenv.mkDerivation rec { pname = "elfutils"; - version = "0.190"; + version = "0.191"; src = fetchurl { url = "https://sourceware.org/elfutils/ftp/${version}/${pname}-${version}.tar.bz2"; - hash = "sha256-jgCjqbXwS8HcJzroYoHS0m7UEgILOR/8wjGY8QIx1pI="; + hash = "sha256-33bbcTZtHXCDZfx6bGDKSDmPFDZ+sriVTvyIlxR62HE="; }; patches = [ diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 849f44ea9bc0..e607967a1205 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -30,11 +30,11 @@ assert pythonSupport -> python3 != null; stdenv.mkDerivation rec { pname = targetPrefix + basename + lib.optionalString hostCpuOnly "-host-cpu-only"; - version = "14.1"; + version = "14.2"; src = fetchurl { url = "mirror://gnu/gdb/${basename}-${version}.tar.xz"; - hash = "sha256-1m31EnYUNFH8v/RkzIcj1o8enfRaai1WNaVOcWQ+24A="; + hash = "sha256-LU3YBh2N7RK2xj9V5FNEiB6CJhBfTSqbI0BA76XOd3I="; }; postPatch = lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/tools/misc/luarocks/default.nix b/pkgs/development/tools/misc/luarocks/default.nix index 8622ca5acd38..49d3eb280a07 100644 --- a/pkgs/development/tools/misc/luarocks/default.nix +++ b/pkgs/development/tools/misc/luarocks/default.nix @@ -19,13 +19,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "luarocks"; - version = "3.10.0"; + version = "3.11.0"; src = fetchFromGitHub { owner = "luarocks"; repo = "luarocks"; rev = "v${finalAttrs.version}"; - hash = "sha256-lM0jbKbV1fNz6AgJX6Pu6rlAzos/wEzn8wTvCBrOOe4="; + hash = "sha256-mSwwBuLWoMT38iYaV/BTdDmmBz4heTRJzxBHC0Vrvc4="; }; patches = [ diff --git a/pkgs/development/tools/spirv-tools/default.nix b/pkgs/development/tools/spirv-tools/default.nix index 648b2615166c..dcf124e151af 100644 --- a/pkgs/development/tools/spirv-tools/default.nix +++ b/pkgs/development/tools/spirv-tools/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "spirv-tools"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "SPIRV-Tools"; rev = "vulkan-sdk-${version}"; - hash = "sha256-RzGvoDt1Qc+f6mZsfs99MxX4YB3yFc5FP92Yx/WGrsI="; + hash = "sha256-WnlFr9M7OI4unCIxfmSkvcLqZFKhW4Qkbb4+xp8lSOo="; }; # The cmake options are sufficient for turning on static building, but not diff --git a/pkgs/development/tools/vulkan-validation-layers/default.nix b/pkgs/development/tools/vulkan-validation-layers/default.nix index 1d0a39fb2b8b..c40a6bbb6e78 100644 --- a/pkgs/development/tools/vulkan-validation-layers/default.nix +++ b/pkgs/development/tools/vulkan-validation-layers/default.nix @@ -23,13 +23,13 @@ let in stdenv.mkDerivation rec { pname = "vulkan-validation-layers"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "Vulkan-ValidationLayers"; rev = "vulkan-sdk-${version}"; - hash = "sha256-hJx8gn0zCN3+DhO6niylZJXPHgQ+VhQV5tL8qAeRaUg="; + hash = "sha256-jBiVbLRbAZEEU8ZYg9Ehx4b5hDJoi7+LnN++zKLSzvA="; }; nativeBuildInputs = [ diff --git a/pkgs/development/tools/watchman/default.nix b/pkgs/development/tools/watchman/default.nix index dc5d1f87fdb3..213aa3f8798e 100644 --- a/pkgs/development/tools/watchman/default.nix +++ b/pkgs/development/tools/watchman/default.nix @@ -34,13 +34,13 @@ stdenv.mkDerivation rec { pname = "watchman"; - version = "2024.01.22.00"; + version = "2024.03.11.00"; src = fetchFromGitHub { owner = "facebook"; repo = "watchman"; rev = "v${version}"; - hash = "sha256-+qlcdekBcRwmgrtQ8HcLHphURf0c4oRCs6nbjAzT26c="; + hash = "sha256-cD8mIYCc+8Z2p3rwKVRFcW9sOBbpb5KHU5VpbXHMpeg="; }; cmakeFlags = [ diff --git a/pkgs/games/cataclysm-dda/glibc-2.39.diff b/pkgs/games/cataclysm-dda/glibc-2.39.diff new file mode 100644 index 000000000000..edc79ce76d79 --- /dev/null +++ b/pkgs/games/cataclysm-dda/glibc-2.39.diff @@ -0,0 +1,28 @@ +diff --git a/src/debug.cpp b/src/debug.cpp +index fa63a3b..1e8f554 100644 +--- a/src/debug.cpp ++++ b/src/debug.cpp +@@ -1494,6 +1494,14 @@ std::string game_info::operating_system() + } + + #if !defined(__CYGWIN__) && !defined (__ANDROID__) && ( defined (__linux__) || defined(unix) || defined(__unix__) || defined(__unix) || ( defined(__APPLE__) && defined(__MACH__) ) || defined(BSD) ) // linux; unix; MacOs; BSD ++ // ++class FILEDeleter ++{ ++ public: ++ void operator()( FILE *f ) const noexcept { ++ pclose( f ); ++ } ++}; + /** Execute a command with the shell by using `popen()`. + * @param command The full command to execute. + * @note The output buffer is limited to 512 characters. +@@ -1504,7 +1512,7 @@ static std::string shell_exec( const std::string &command ) + std::vector buffer( 512 ); + std::string output; + try { +- std::unique_ptr pipe( popen( command.c_str(), "r" ), pclose ); ++ std::unique_ptr pipe( popen( command.c_str(), "r" ) ); + if( pipe ) { + while( fgets( buffer.data(), buffer.size(), pipe.get() ) != nullptr ) { + output += buffer.data(); diff --git a/pkgs/games/cataclysm-dda/stable.nix b/pkgs/games/cataclysm-dda/stable.nix index 90eab89a8349..5c3ccb4bf287 100644 --- a/pkgs/games/cataclysm-dda/stable.nix +++ b/pkgs/games/cataclysm-dda/stable.nix @@ -43,6 +43,9 @@ let url = "https://sources.debian.org/data/main/c/cataclysm-dda/0.G-4/debian/patches/gcc13-keyword-requires.patch"; hash = "sha256-8yvHh0YKC7AC/qzia7AZAfMewMC0RiSepMXpOkMXRd8="; }) + # Fix build w/ glibc-2.39 + # From https://github.com/BrettDong/Cataclysm-DDA/commit/9b206e2dc969ad79345596e03c3980bd155d2f48 + ./glibc-2.39.diff ]; makeFlags = common.makeFlags ++ [ diff --git a/pkgs/os-specific/darwin/CoreSymbolication/default.nix b/pkgs/os-specific/darwin/CoreSymbolication/default.nix index d9a2b378134a..f6b0e2b79c3d 100644 --- a/pkgs/os-specific/darwin/CoreSymbolication/default.nix +++ b/pkgs/os-specific/darwin/CoreSymbolication/default.nix @@ -1,8 +1,14 @@ -{ lib, fetchFromGitHub, fetchpatch, stdenv }: +{ + lib, + fetchFromGitHub, + fetchpatch, + stdenvNoCC, + darwin-stubs, +}: -stdenv.mkDerivation { - pname = "core-symbolication"; - version = "unstable-2018-06-17"; +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "CoreSymbolication"; + inherit (darwin-stubs) version; src = fetchFromGitHub { repo = "CoreSymbolication"; @@ -12,15 +18,35 @@ stdenv.mkDerivation { }; patches = [ - # C99 compilation fix - # https://github.com/matthewbauer/CoreSymbolication/pull/1 + # Add missing symbol definitions needed to build `zlog` in system_cmds. + # https://github.com/matthewbauer/CoreSymbolication/pull/2 (fetchpatch { - url = "https://github.com/boltzmannrain/CoreSymbolication/commit/1c26cc93f260bda9230a93e91585284e80aa231f.patch"; - hash = "sha256-d/ieDEnvZ9kVOjBVUdJzGmdvC1AF3Jk4fbwp04Q6l/I="; + url = "https://github.com/matthewbauer/CoreSymbolication/commit/ae7ac6a7043dbae8e63d6ce5e63dfaf02b5977fe.patch"; + hash = "sha256-IuXGMsaR1LIGs+BpDU1b4YlznKm9VhK5DQ+Dthtb1mI="; + }) + (fetchpatch { + url = "https://github.com/matthewbauer/CoreSymbolication/commit/6531da946949a94643e6d8424236174ae64fe0ca.patch"; + hash = "sha256-+nDX04yY92yVT9KxiAFY2LxKcS7P8JpU539K+YVRqV4="; }) ]; - makeFlags = [ "PREFIX=$(out)" "CC=${stdenv.cc.targetPrefix}cc" ]; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/Library/Frameworks/CoreSymbolication.framework/Versions/A/Headers + + ln -s A $out/Library/Frameworks/CoreSymbolication.framework/Versions/Current + ln -s Versions/Current/Headers $out/Library/Frameworks/CoreSymbolication.framework/Headers + ln -s Versions/Current/CoreSymbolication.tbd $out/Library/Frameworks/CoreSymbolication.framework/CoreSymbolication.tbd + + cp *.h $out/Library/Frameworks/CoreSymbolication.framework/Versions/A/Headers + cp ${darwin-stubs}/System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication.tbd \ + $out/Library/Frameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication.tbd + + runHook postInstall + ''; meta = with lib; { description = "Reverse engineered headers for Apple's CoreSymbolication framework"; @@ -29,4 +55,4 @@ stdenv.mkDerivation { platforms = platforms.darwin; maintainers = with maintainers; [ matthewbauer ]; }; -} +}) diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix index 0e908d0179db..518ab4230156 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix @@ -143,5 +143,16 @@ let }); xcbuild = xcodebuild; })); + + darwin-stubs = stdenvNoCC.mkDerivation { + pname = "darwin-stubs"; + inherit (MacOSX-SDK) version; + + buildCommand = '' + mkdir -p "$out" + ln -s ${MacOSX-SDK}/System "$out/System" + ln -s ${MacOSX-SDK}/usr "$out/usr" + ''; + }; }; in packages diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 5484ba5acb18..962f7f681c49 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -350,5 +350,7 @@ in rec { frameworks = bareFrameworks // overrides bareFrameworks; + inherit darwin-stubs; + inherit sdk; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index ab13e91e3735..8a562cc82558 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -6,6 +6,9 @@ let # a stdenv out of something like this. With some care we can probably get rid of this, but for # now it's staying here. versions = { + "macos-14.3" = { + system_cmds = "970.0.4"; + }; "osx-10.12.6" = { xnu = "3789.70.16"; libiconv = "50"; @@ -155,7 +158,7 @@ let version = versions.${sdkName}.${pname}; in fetchApple' pname version sha256; - appleDerivation'' = stdenv: pname: version: sdkName: sha256: attrs: stdenv.mkDerivation ({ + appleDerivation'' = stdenv: pname: version: sdkName: sha256: attrs: stdenv.mkDerivation (finalAttrs: { inherit pname version; src = if attrs ? srcs then null else (fetchApple' pname version sha256); @@ -181,7 +184,7 @@ let fi ''; - } // attrs // { + } // (if builtins.isFunction attrs then attrs finalAttrs else attrs) // { meta = (with lib; { platforms = platforms.darwin; license = licenses.apsl20; @@ -276,7 +279,9 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // { libmalloc = if stdenv.isx86_64 then applePackage "libmalloc" "osx-10.12.6" "sha256-brfG4GEF2yZipKdhlPq6DhT2z5hKYSb2MAmffaikdO4=" {} else macosPackages_11_0_1.libmalloc; - libplatform = applePackage "libplatform" "osx-10.12.6" "sha256-6McMTjw55xtnCsFI3AB1osRagnuB5pSTqeMKD3gpGtM=" {}; + libplatform = if stdenv.isx86_64 then + applePackage "libplatform" "osx-10.12.6" "sha256-6McMTjw55xtnCsFI3AB1osRagnuB5pSTqeMKD3gpGtM=" {} + else macosPackages_11_0_1.libplatform; libpthread = applePackage "libpthread" "osx-10.12.6" "sha256-QvJ9PERmrCWBiDmOWrLvQUKZ4JxHuh8gS5nlZKDLqE8=" {}; libresolv = applePackage "libresolv" "osx-10.12.6" "sha256-FtvwjJKSFX6j9APYPC8WLXVOjbHLZa1Gcoc8yxLy8qE=" {}; Libsystem = applePackage "Libsystem" "osx-10.12.6" "sha256-zvRdCP//TjKCGAqm/5nJXPppshU1cv2fg/L/yK/olGQ=" {}; @@ -304,7 +309,7 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // { else macosPackages_11_0_1.network_cmds; file_cmds = applePackage "file_cmds" "osx-10.11.6" "sha256-JYy6HwmultKeZtLfaysbsyLoWg+OaTh7eJu54JkJC0Q=" {}; shell_cmds = applePackage "shell_cmds" "osx-10.11.6" "sha256-kmEOprkiJGMVcl7yHkGX8ymk/5KjE99gWuF8j2hK5hY=" {}; - system_cmds = applePackage "system_cmds" "osx-10.11.6" "sha256-KBdGlHeXo2PwgRQOOeElJ1RBqCY1Tdhn5KD42CMhdzI=" {}; + system_cmds = applePackage "system_cmds" "macos-14.3" "sha256-qFp9nkzsq9uQ7zoyfvO+3gvDlc7kaPvn6luvmO/Io30=" {}; text_cmds = applePackage "text_cmds" "osx-10.11.6" "sha256-KSebU7ZyUsPeqn51nzuGNaNxs9pvmlIQQdkWXIVzDxw=" {}; top = applePackage "top" "osx-10.11.6" "sha256-jbz64ODogtpNyLpXGSZj1jCBdFPVXcVcBkL1vc7g5qQ=" {}; PowerManagement = applePackage "PowerManagement" "osx-10.11.6" "sha256-bYGtYnBOcE5W03AZzfVTJXPZ6GgryGAMt/LgLPxFkVk=" {}; diff --git a/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix index 39c801962692..e0b25d27778a 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix @@ -1,9 +1,10 @@ -{ appleDerivation', stdenvNoCC }: +{ lib, appleDerivation', stdenvNoCC }: -appleDerivation' stdenvNoCC { +appleDerivation' stdenvNoCC (finalAttrs: { installPhase = '' mkdir $out cp -r include $out/include + test -d private && cp -r private/* $out/include ''; appleHeaders = '' @@ -27,6 +28,12 @@ appleDerivation' stdenvNoCC { platform/introspection_private.h platform/string.h setjmp.h - ucontext.h - ''; -} + '' + ( + if lib.versionAtLeast finalAttrs.version "254.40.4" then '' + string_x86.h + ucontext.h + '' else '' + ucontext.h + '' + ); +}) diff --git a/pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix b/pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix index 0a70e648695d..b4a7bbc4df24 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix @@ -40,7 +40,6 @@ objc4 = applePackage' "objc4" "818.2" "macos-11.0.1" "0m8mk1qd18wqjfn2jsq2lx6fxv ppp = applePackage' "ppp" "877.40.2" "macos-11.0.1" "06xznc77j45zzi12m4cmr3jj853qlc8dbmynbg1z6m9qf5phdbgk" {}; removefile = applePackage' "removefile" "49.40.3" "macos-11.0.1" "0870ihxpmvj8ggaycwlismbgbw9768lz7w6mc9vxf8l6nlc43z4f" {}; shell_cmds = applePackage' "shell_cmds" "216.40.4" "macos-11.0.1" "0wbysc9lwf1xgl686r3yn95rndcmqlp17zc1ig9gsl5fxyy5bghh" {}; -system_cmds = applePackage' "system_cmds" "880.40.5" "macos-11.0.1" "064yqf84ny0cjpqmzmnhz05faay6axb2r4i6knnyc8n21yiip5dc" {}; text_cmds = applePackage' "text_cmds" "106" "macos-11.0.1" "17fn35m6i866zjrf8da6cq6crydp6vp4zq0aaab243rv1fx303yy" {}; top = applePackage' "top" "129" "macos-11.0.1" "0d9pqmv3mwkfcv7c05hfvnvnn4rbsl92plr5hsazp854pshzqw2k" {}; xnu = applePackage' "xnu" "7195.50.7.100.1" "macos-11.0.1" "11zjmpw11rcc6a0xlbwramra1rsr65s4ypnxwpajgbr2c657lipl" {}; diff --git a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix index f708d7740900..7bd3cae118eb 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix @@ -1,114 +1,161 @@ -{ stdenv, appleDerivation, lib -, libutil, Librpcsvc, apple_sdk, pam, CF, openbsm }: +{ + lib, + stdenv, + stdenvNoCC, + appleDerivation, + fetchFromGitHub, + runCommand, + gawk, + meson, + ninja, + pkg-config, + libdispatch, + libmalloc, + libplatform, + Librpcsvc, + libutil, + ncurses, + openbsm, + pam, + xnu, + CoreFoundation, + CoreSymbolication, + DirectoryService, + IOKit, + Kernel, + Libc, + OpenDirectory, + WebKit, +}: -appleDerivation { - # xcbuild fails with: - # /nix/store/fc0rz62dh8vr648qi7hnqyik6zi5sqx8-xcbuild-wrapper/nix-support/setup-hook: line 1: 9083 Segmentation fault: 11 xcodebuild OTHER_CFLAGS="$NIX_CFLAGS_COMPILE" OTHER_CPLUSPLUSFLAGS="$NIX_CFLAGS_COMPILE" OTHER_LDFLAGS="$NIX_LDFLAGS" build - # see issue facebook/xcbuild#188 - # buildInputs = [ xcbuild ]; +let + OpenDirectoryPrivate = stdenvNoCC.mkDerivation (finalAttrs: { + name = "apple-private-framework-OpenDirectory"; + version = "146"; - buildInputs = [ libutil Librpcsvc apple_sdk.frameworks.OpenDirectory pam CF - apple_sdk.frameworks.IOKit openbsm ]; - # env.NIX_CFLAGS_COMPILE = lib.optionalString hostPlatform.isi686 "-D__i386__" - # + lib.optionalString hostPlatform.isx86_64 "-D__x86_64__" - # + lib.optionalString hostPlatform.isAarch32 "-D__arm__"; - env.NIX_CFLAGS_COMPILE = toString ([ "-DDAEMON_UID=1" - "-DDAEMON_GID=1" - "-DDEFAULT_AT_QUEUE='a'" - "-DDEFAULT_BATCH_QUEUE='b'" - "-DPERM_PATH=\"/usr/lib/cron/\"" - "-DOPEN_DIRECTORY" - "-DNO_DIRECT_RPC" - "-DAPPLE_GETCONF_UNDERSCORE" - "-DAPPLE_GETCONF_SPEC" - "-DUSE_PAM" - "-DUSE_BSM_AUDIT" - "-D_PW_NAME_LEN=MAXLOGNAME" - "-D_PW_YPTOKEN=\"__YP!\"" - "-DAHZV1=64 " - "-DAU_SESSION_FLAG_HAS_TTY=0x4000" - "-DAU_SESSION_FLAG_HAS_AUTHENTICATED=0x4000" - ] ++ lib.optional (!stdenv.isLinux) " -D__FreeBSD__ "); + src = fetchFromGitHub { + owner = "apple-oss-distributions"; + repo = "OpenDirectory"; + rev = "OpenDirectory-${finalAttrs.version}"; + hash = "sha256-6fSl8PasCZSBfe0ftaePcBuSEO3syb6kK+mfDI6iR7A="; + }; - patches = [ - # Fix implicit declarations that cause builds to fail when built with clang 16. - ./fix-implicit-declarations.patch + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/include/CFOpenDirectory" "$out/include/OpenDirectory" + install -t "$out/include/CFOpenDirectory" \ + Core/CFOpenDirectoryPriv.h \ + Core/CFODTrigger.h + touch "$out/include/CFOpenDirectory/CFOpenDirectoryConstantsPriv.h" + install -t "$out/include/OpenDirectory" \ + Framework/OpenDirectoryPriv.h \ + Framework/NSOpenDirectoryPriv.h + + runHook postInstall + ''; + }); + + libmallocPrivate = stdenvNoCC.mkDerivation { + pname = "libmalloc-private"; + version = lib.getVersion libmalloc; + + inherit (libmalloc) src; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/include" + cp -r private/*.h "$out/include" + + runHook postInstall + ''; + }; + + # Private xnu headers that are part of the source tree but not in the xnu derivation. + xnuPrivate = stdenvNoCC.mkDerivation { + pname = "xnu-private"; + version = lib.getVersion xnu; + + inherit (xnu) src; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/include" + cp libsyscall/wrappers/spawn/spawn_private.h "$out/include" + + runHook postInstall + ''; + }; +in +appleDerivation (finalAttrs: { + nativeBuildInputs = [ + gawk + meson + ninja + pkg-config + ]; + + buildInputs = [ + libdispatch + libplatform + Librpcsvc + libutil + ncurses + openbsm + pam + xnu + CoreFoundation + CoreSymbolication + DirectoryService + IOKit + Kernel + OpenDirectory ]; postPatch = '' - substituteInPlace login.tproj/login.c \ - --replace bsm/audit_session.h bsm/audit.h - substituteInPlace login.tproj/login_audit.c \ - --replace bsm/audit_session.h bsm/audit.h - '' + lib.optionalString stdenv.isAarch64 '' - substituteInPlace sysctl.tproj/sysctl.c \ - --replace "GPROF_STATE" "0" - substituteInPlace login.tproj/login.c \ - --replace "defined(__arm__)" "defined(__arm__) || defined(__arm64__)" + # Replace hard-coded, impure system paths with the output path in the store. + sed -e "s|PATH=[^;]*|PATH='$out/bin'|" -i "pagesize/pagesize.sh" ''; - buildPhase = '' - for dir in *.tproj; do - name=$(basename $dir) - name=''${name%.tproj} - - CFLAGS="" - case $name in - arch) CFLAGS="-framework CoreFoundation";; - atrun) CFLAGS="-Iat.tproj";; - chkpasswd) - CFLAGS="-framework OpenDirectory -framework CoreFoundation -lpam";; - getconf) - for f in getconf.tproj/*.gperf; do - cfile=''${f%.gperf}.c - LC_ALL=C awk -f getconf.tproj/fake-gperf.awk $f > $cfile - done - ;; - iostat) CFLAGS="-framework IOKit -framework CoreFoundation";; - login) CFLAGS="-lbsm -lpam";; - nvram) CFLAGS="-framework CoreFoundation -framework IOKit";; - sadc) CFLAGS="-framework IOKit -framework CoreFoundation";; - sar) CFLAGS="-Isadc.tproj";; - esac - - echo "Building $name" - - case $name in - - # These are all broken currently. - arch) continue;; - chpass) continue;; - dirhelper) continue;; - dynamic_pager) continue;; - fs_usage) continue;; - latency) continue;; - pagesize) continue;; - passwd) continue;; - reboot) continue;; - sc_usage) continue;; - shutdown) continue;; - trace) continue;; - - *) cc $dir/*.c -I''${dir} $CFLAGS -o $name ;; - esac - done + # A vendored meson.build is used instead of the upstream Xcode project. + # This is done for a few reasons: + # - The upstream project causes `xcbuild` to crash. + # See: https://github.com/facebookarchive/xcbuild/issues/188; + # - Achieving the same flexibility regarding SDK version would require modifying the + # Xcode project, but modifying Xcode projects without using Xcode is painful; and + # - Using Meson allows the derivation to leverage the robust Meson support in nixpkgs, + # and it allows it to use Meson features to simplify the build (e.g., generators). + preConfigure = '' + substitute '${./meson.build}' meson.build \ + --subst-var-by kernel '${Kernel}' \ + --subst-var-by libc_private '${Libc}' \ + --subst-var-by libmalloc_private '${libmallocPrivate}' \ + --subst-var-by opendirectory '${OpenDirectory}' \ + --subst-var-by opendirectory_private '${OpenDirectoryPrivate}' \ + --subst-var-by xnu '${xnu}' \ + --subst-var-by xnu_private '${xnuPrivate}' \ + --subst-var-by version '${finalAttrs.version}' + cp '${./meson.options}' meson.options ''; - installPhase = '' - for dir in *.tproj; do - name=$(basename $dir) - name=''${name%.tproj} - [ -x $name ] && install -D $name $out/bin/$name - for n in 1 2 3 4 5 6 7 8 9; do - for f in $dir/*.$n; do - install -D $f $out/share/man/man$n/$(basename $f) - done - done - done - ''; + mesonFlags = [ (lib.mesonOption "sdk_version" stdenv.hostPlatform.darwinSdkVersion) ]; meta = { platforms = lib.platforms.darwin; - maintainers = with lib.maintainers; [ shlevy matthewbauer ]; + maintainers = with lib.maintainers; [ + shlevy + matthewbauer + ]; }; -} +}) diff --git a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/fix-implicit-declarations.patch b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/fix-implicit-declarations.patch deleted file mode 100644 index b08f54045724..000000000000 --- a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/fix-implicit-declarations.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -ur a/getty.tproj/main.c b/getty.tproj/main.c ---- a/getty.tproj/main.c 2008-06-10 14:50:19.000000000 -0400 -+++ b/getty.tproj/main.c 2023-05-31 18:06:40.121028558 -0400 -@@ -67,6 +67,7 @@ - #include - #include - #include -+#include - #include - - #ifdef __APPLE__ -@@ -152,7 +153,7 @@ - static void putpad(const char *); - static void puts(const char *); - static void timeoverrun(int); --static char *getline(int); -+static char *get_line(int); - static void setttymode(int); - static int opentty(const char *, int); - -@@ -352,7 +353,7 @@ - if ((fd = open(IF, O_RDONLY)) != -1) { - char * cp; - -- while ((cp = getline(fd)) != NULL) { -+ while ((cp = get_line(fd)) != NULL) { - putf(cp); - } - close(fd); -@@ -744,7 +745,7 @@ - - - static char * --getline(int fd) -+get_line(int fd) - { - int i = 0; - static char linebuf[512]; ---- a/newgrp.tproj/newgrp.c 2021-10-06 01:38:52.000000000 -0400 -+++ b/newgrp.tproj/newgrp.c 2023-05-31 22:26:50.656157841 -0400 -@@ -47,6 +47,7 @@ - #include - #include - #ifdef __APPLE__ -+#include - #include - #endif /* __APPLE__ */ - static void addgroup(const char *grpname); diff --git a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/meson.build b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/meson.build new file mode 100644 index 000000000000..de73e88f5d4d --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/meson.build @@ -0,0 +1,544 @@ +# Build settings based on the upstream Xcode project. +# See: https://github.com/apple-oss-distributions/system_cmds/blob/main/system_cmds.xcodeproj/project.pbxproj + + +# Project settings +project('system_cmds', 'c', version : '@version@') + +if host_machine.system() != 'linux' + add_project_arguments('-D__FreeBSD__', language : 'c') +endif + +sdk_version = get_option('sdk_version') + + +# Dependencies +cc = meson.get_compiler('c') +# Upstream uses awk to process `.gperf` files instead of gperf, which can’t process them. +fake_gperf = find_program('awk', required : true) + +## Frameworks +core_foundation = dependency('appleframeworks', modules : 'CoreFoundation') +core_symbolication = dependency('appleframeworks', modules : 'CoreSymbolication') +directory_service = dependency('appleframeworks', modules : 'DirectoryService') +iokit = dependency('appleframeworks', modules : 'IOKit') +kernel = declare_dependency(include_directories : '@kernel@/Library/Frameworks/Kernel.framework/Headers') +open_directory = dependency('appleframeworks', modules : 'OpenDirectory') + +## Private Headers +cfopen_directory = declare_dependency( + dependencies : declare_dependency( + compile_args :[ '-iframework', '@opendirectory@/Library/Frameworks/OpenDirectory.framework/Frameworks' ], + ), + include_directories : '@opendirectory_private@/include', +) +libc_private = declare_dependency(include_directories : '@libc_private@/include') +libmalloc_private = declare_dependency(include_directories : '@libmalloc_private@/include') + +xnu_include_dirs = [ + '@xnu@/include/bsd', + '@xnu@/include/libkern', + '@xnu@/include/iokit', + '@xnu@/include/osfmk', + '@xnu_private@/include' +] +if sdk_version.version_compare('>=10.13') + xnu_include_dirs += '@xnu@/include/san' +endif +xnu_private = declare_dependency( + compile_args : [ + # Suppresses suffixing symbols with '$UNIX2003', which causes link failures. + '-D__DARWIN_ONLY_UNIX_CONFORMANCE=1', + # Make sure Darwin is correctly detected as macOS + '-DPLATFORM_MacOSX=1', + # Access private definitions + '-DPRIVATE=1' + ], + include_directories : xnu_include_dirs +) + +## Libraries +ncurses = dependency('ncurses') +openbsm = cc.find_library('bsm') +pam = cc.find_library('pam') + +# Feature Tests +if sdk_version.version_compare('<12') + add_project_arguments('-DkIOMainPortDefault=kIOMasterPortDefault', language : 'c') + add_project_arguments('-DIOMainPort=IOMasterPort', language : 'c') +endif + + +# Generators +pgperf = generator( + fake_gperf, + arguments : [ '-f', meson.source_root() + '/getconf/fake-gperf.awk', '@INPUT@' ], + capture : true, + output : '@BASENAME@.gperf.c' +) + + +# Binaries +executable('ac', install : true, sources : 'ac/ac.c') +install_man('ac/ac.8') + +executable('accton', install : true, sources : 'accton/accton.c') +install_man('accton/accton.8') + +executable( + 'arch', + build_by_default : sdk_version.version_compare('>=11'), + install : sdk_version.version_compare('>=11'), + sources : 'arch/arch.c' +) +install_man( + 'arch/arch.1', + 'arch/machine.1' +) + +executable( + 'at', + c_args : [ + '-DDAEMON_UID=1', + '-DDAEMON_GID=1', + '-DDEFAULT_AT_QUEUE=\'a\'', + '-DDEFAULT_BATCH_QUEUE=\'b\'', + '-DPERM_PATH="/usr/lib/cron"', + ], + install : true, + sources : [ + 'at/at.c', + 'at/panic.c', + 'at/parsetime.c', + 'at/perm.c' + ] +) +install_man('at/at.1') + +executable( + 'atrun', + c_args : [ '-DDAEMON_UID=1', '-DDAEMON_GID=1' ], + include_directories : 'at', + install : true, + sources : [ + 'atrun/atrun.c', + 'atrun/gloadavg.c' + ] +) +install_man('atrun/atrun.8') + +executable( + 'chkpasswd', + c_args : '-DUSE_PAM', + dependencies : [ core_foundation, open_directory, pam ], + install : true, + sources : [ + 'chkpasswd/file_passwd.c', + 'chkpasswd/nis_passwd.c', + 'chkpasswd/od_passwd.c', + 'chkpasswd/pam_passwd.c', + 'chkpasswd/passwd.c', + 'chkpasswd/stringops.c' + ] +) +install_man('chkpasswd/chkpasswd.8') + +executable( + 'chpass', + dependencies : [ cfopen_directory, directory_service, open_directory ], + install : true, + sources : [ + 'chpass/chpass.c', + 'chpass/edit.c', + 'chpass/field.c', + 'chpass/open_directory.c', + 'chpass/table.c', + 'chpass/util.c' + ] +) +install_man('chpass/chpass.1') + +executable('cpuctl', install : true, sources : 'cpuctl/cpuctl.c') +install_man('cpuctl/cpuctl.8') + +executable('dmesg', install : true, sources : 'dmesg/dmesg.c') +install_man('dmesg/dmesg.8') + +executable( + 'dynamic_pager', + c_args : '-DNO_DIRECT_RPC', + install : true, + sources : 'dynamic_pager/dynamic_pager.c' +) +install_man('dynamic_pager/dynamic_pager.8') + +executable( + 'fs_usage', + # Requires 'ktrace/session.h' + build_by_default : false, + install : false, + sources : 'fs_usage/fs_usage.c' +) +# install_man('fs_usage/fs_usage.1') + +executable( + 'gcore', + # Requires XPC private APIs + build_by_default : false and sdk_version.version_compare('>=11'), + install : false and sdk_version.version_compare('>=11'), + sources : [ + 'gcore/convert.c', + 'gcore/corefile.c', + 'gcore/dyld.c', + 'gcore/dyld_shared_cache.c', + 'gcore/main.c', + 'gcore/sparse.c', + 'gcore/threads.c', + 'gcore/utils.c', + 'gcore/vanilla.c', + 'gcore/vm.c' + ] +) +# install_man('gcore/gcore-internal.1', 'gcore/gcore.1') + +executable( + 'getconf', + c_args : '-DAPPLE_GETCONF_UNDERSCORE', + include_directories : 'getconf', + install : true, + sources : [ + 'getconf/getconf.c', + ] + pgperf.process( + [ + 'getconf/confstr.gperf', + 'getconf/limits.gperf', + 'getconf/unsigned_limits.gperf', + 'getconf/progenv.gperf', + 'getconf/sysconf.gperf', + 'getconf/pathconf.gperf' + ] + ) +) +install_man('getconf/getconf.1') + +executable( + 'getty', + install : true, + sources : [ + 'getty/chat.c', + 'getty/init.c', + 'getty/main.c', + 'getty/subr.c' + ] +) +install_man( + 'getty/getty.8', + 'getty/gettytab.5', + 'getty/ttys.5' +) + +executable('hostinfo', install : true, sources : 'hostinfo/hostinfo.c') +install_man('hostinfo/hostinfo.8') + +executable( + 'iosim', + dependencies : [ core_foundation, iokit ], + include_directories : 'at', + install : true, + sources : 'iosim/iosim.c' +) +install_man('iosim/iosim.1') + +executable( + 'iostat', + dependencies : [ core_foundation, iokit ], + install : true, + sources : 'iostat/iostat.c' +) +install_man('iostat/iostat.8') + +executable( + 'kpgo', + dependencies : [ xnu_private ], + install : true, + sources : 'kpgo/kpgo.c' +) +# No man pages for `kpgo` + +executable( + 'latency', + build_by_default : sdk_version.version_compare('>=12'), + dependencies : ncurses, + install : sdk_version.version_compare('>=12'), + sources : 'latency/latency.c' +) +if sdk_version.version_compare('>=12') + install_man('latency/latency.1') +endif + +executable( + 'login', + # Requires SoftLinking/WeakLinking.h and end-point security entitlements + build_by_default : false, + c_args : '-DUSE_BSM_AUDIT=1', + dependencies : [ openbsm, xnu_private ], + install : false, + sources : [ + 'login/login.c', + 'login/login_audit.c' + ] +) +# install_man('login/login.1') + +executable( + 'lskq', + build_by_default : sdk_version.version_compare('>=12'), + install : sdk_version.version_compare('>=12'), + sources : 'lskq/lskq.c' +) +if sdk_version.version_compare('>=12') + install_man('lskq/lskq.1') +endif + +executable( + 'lsmp', + build_by_default : sdk_version.version_compare('>=12'), + install : sdk_version.version_compare('>=12'), + sources : [ + 'lsmp/lsmp.c', + 'lsmp/port_details.c', + 'lsmp/task_details.c' + ] +) +if sdk_version.version_compare('>=12') + install_man('lsmp/lsmp.1') +endif + +executable( + 'ltop', + install : true, + sources : 'ltop/ltop.c' +) +install_man('ltop/ltop.1') + +executable('mean', install : true, sources : 'mean/mean.c') +# No man pages for `mean`. + +executable( + 'memory_pressure', + dependencies : [ xnu_private ], + install : true, + sources : 'memory_pressure/memory_pressure.c' +) +install_man('memory_pressure/memory_pressure.1') + +executable('mkfile', install : true, sources : 'mkfile/mkfile.c') +install_man('mkfile/mkfile.8') + +executable( + 'mslutil', + build_by_default : sdk_version.version_compare('>=10.13'), + dependencies : [ libmalloc_private ], + install : sdk_version.version_compare('>=10.13'), + sources : 'mslutil/mslutil.c' +) +if sdk_version.version_compare('>=10.13') + install_man('mslutil/mslutil.1') +endif + +executable('newgrp', install : true, sources : 'newgrp/newgrp.c') +install_man('newgrp/newgrp.1') + +executable('nologin', install : true, sources : 'nologin/nologin.c') +install_man( + 'nologin/nologin.5', + 'nologin/nologin.8' +) + +executable( + 'nvram', + c_args : '-DTARGET_OS_BRIDGE=0', + dependencies : [ iokit, libc_private, xnu_private ], + install : true, + sources : 'nvram/nvram.c' +) +install_man('nvram/nvram.8') + +custom_target( + 'pagesize', + command : [ 'cp', '@INPUT@', '@OUTPUT@' ], + install : true, + install_dir : get_option('bindir'), + install_mode : 'r-xr-xr-x', + input : 'pagesize/pagesize.sh', + output : 'pagesize' +) +install_man('pagesize/pagesize.1') + +executable( + 'passwd', + dependencies : [ cfopen_directory, directory_service, open_directory, pam ], + install : true, + sources : [ + 'passwd/file_passwd.c', + 'passwd/nis_passwd.c', + 'passwd/od_passwd.c', + 'passwd/pam_passwd.c', + 'passwd/passwd.c' + ] +) +install_man('passwd/passwd.1') + +executable( + 'proc_uuid_policy', + install : true, + sources : 'proc_uuid_policy/proc_uuid_policy.c' +) +install_man('proc_uuid_policy/proc_uuid_policy.1') + +executable('purge', install : true, sources : 'purge/purge.c') +install_man('purge/purge.8') + +executable( + 'pwd_mkdb', + c_args : [ '-D_PW_NAME_LEN=MAXLOGNAME', '-D_PW_YPTOKEN="__YP!"' ], + install : true, + sources : [ + 'pwd_mkdb/pw_scan.c', + 'pwd_mkdb/pwd_mkdb.c' + ] +) +install_man('pwd_mkdb/pwd_mkdb.8') + +executable( + 'reboot', + # Requires IOKitUser kext APIs + build_by_default : false, + install : false, + sources : 'reboot/reboot.c' +) +# install_man('reboot/reboot.8') + +executable( + 'sa', + c_args : '-DAHZV1', + install : true, + sources : [ + 'sa/db.c', + 'sa/main.c', + 'sa/pdb.c', + 'sa/usrdb.c' + ] +) +install_man('sa/sa.8') + +executable( + 'sc_usage', + build_by_default : sdk_version.version_compare('>=12'), + dependencies : ncurses, + install : sdk_version.version_compare('>=12'), + sources : 'sc_usage/sc_usage.c' +) +if sdk_version.version_compare('>=12') + install_man('sc_usage/sc_usage.1') +endif + +executable('shutdown', + # Requires IOKitUser kext APIs + build_by_default : false, + install : false, + sources : 'shutdown/shutdown.c' +) +# install_man('shutdown/shutdown.8') + +executable( + 'stackshot', + build_by_default : sdk_version.version_compare('>=10.13'), + dependencies : [ xnu_private ], + install : sdk_version.version_compare('>=10.13'), + sources : 'stackshot/stackshot.c' +) +# No man pages for `stackshot`. + +executable('sync', install : true, sources : 'sync/sync.c') +# No man pages for `sync`. + +executable('sysctl', install : true, sources : 'sysctl/sysctl.c') +install_man( + 'sysctl/sysctl.8', + 'sysctl/sysctl.conf.5' +) + +executable( + 'taskpolicy', + build_by_default : sdk_version.version_compare('>=11'), + dependencies : [ xnu_private ], + install : sdk_version.version_compare('>=11'), + sources : 'taskpolicy/taskpolicy.c' +) +if sdk_version.version_compare('>=11') + install_man('taskpolicy/taskpolicy.8') +endif + +executable('vifs', install : true, sources : 'vifs/vifs.c') +install_man('vifs/vifs.8') + +executable( + 'vipw', + install : true, + sources : [ + 'vipw/pw_util.c', + 'vipw/vipw.c' + ] +) +install_man('vipw/vipw.8') + +executable('vm_purgeable_stat', + build_by_default : sdk_version.version_compare('>=11'), + install : sdk_version.version_compare('>=11'), + sources : 'vm_purgeable_stat/vm_purgeable_stat.c' +) +if sdk_version.version_compare('>=11') + install_man('vm_purgeable_stat/vm_purgeable_stat.1') +endif + +executable('vm_stat', install : true, sources : 'vm_stat/vm_stat.c') +install_man('vm_stat/vm_stat.1') + +executable('wait4path', install : true, sources : 'wait4path/wait4path.c') +install_man('wait4path/wait4path.1') + +executable('wordexp-helper', install : true, sources : 'wordexp-helper/wordexp-helper.c') +# No man pages for `wordexp-helper`. + +executable('zdump', include_directories : 'zic', install : true, sources : 'zdump/zdump.c') +install_man('zdump/zdump.8') + +executable('zic', install : true, sources : 'zic/zic.c') +install_man('zic/zic.8') + +executable( + 'zlog', + build_by_default : sdk_version.version_compare('>=11'), + c_args : '-DKERN_NOT_FOUND=56', + dependencies : core_symbolication, + install : sdk_version.version_compare('>=11'), + sources : [ + 'zlog/SymbolicationHelper.c', + 'zlog/zlog.c', + ] +) +if sdk_version.version_compare('>=11') + install_man('zlog/zlog.1') +endif + +executable( + 'zprint', + # Requires IOKitUser kext APIs + build_by_default : false, + dependencies: [ kernel ], + install : false, + sources : 'zprint/zprint.c' +) +# install_man('zprint/zprint.1') + diff --git a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/meson.options b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/meson.options new file mode 100644 index 000000000000..8c4ce874c64c --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/meson.options @@ -0,0 +1 @@ +option('sdk_version', type : 'string') diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix index 03eb1959c9b2..e2e4384908a8 100644 --- a/pkgs/os-specific/linux/iproute/default.nix +++ b/pkgs/os-specific/linux/iproute/default.nix @@ -6,11 +6,11 @@ stdenv.mkDerivation rec { pname = "iproute2"; - version = "6.7.0"; + version = "6.8.0"; src = fetchurl { url = "mirror://kernel/linux/utils/net/${pname}/${pname}-${version}.tar.xz"; - hash = "sha256-/5Qt2YKNfR+Gf2H+cs5DMHjDHl2OSnjiDwLLWJLohB0="; + hash = "sha256-A6bMo9cakI0fFfe0lb4rj+hR+UFFjcRmSQDX9F/PaM4="; }; postPatch = '' diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix index e7aa16d3dd39..7f2195529c6c 100644 --- a/pkgs/os-specific/linux/mdadm/default.nix +++ b/pkgs/os-specific/linux/mdadm/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "mdadm"; - version = "4.2"; + version = "4.3"; src = fetchurl { url = "mirror://kernel/linux/utils/raid/mdadm/mdadm-${version}.tar.xz"; - sha256 = "sha256-RhwhVnCGS7dKTRo2IGhKorL4KW3/oGdD8m3aVVes8B0="; + sha256 = "sha256-QWcnrh8QgOpuMJDOo23QdoJvw2kVHjarc2VXupIZb58="; }; patches = [ ./no-self-references.patch ]; diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 05e66dd704af..d07150493fc3 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -176,7 +176,7 @@ assert withBootloader -> withEfi; let wantCurl = withRemote || withImportd; wantGcrypt = withResolved || withImportd; - version = "255.2"; + version = "255.4"; # Use the command below to update `releaseTimestamp` on every (major) version # change. More details in the commentary at mesonFlags. @@ -194,7 +194,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "systemd"; repo = "systemd-stable"; rev = "v${version}"; - hash = "sha256-8SfJY/pcH4yrDeJi0GfIUpetTbpMwyswvSu+RSfgqfY="; + hash = "sha256-P1mKq+ythrv8MU7y2CuNtEx6qCDacugzfsPRZL+NPys="; }; # On major changes, or when otherwise required, you *must* : diff --git a/pkgs/servers/ldap/389/default.nix b/pkgs/servers/ldap/389/default.nix index 18aeea04cb62..ce61f9676e18 100644 --- a/pkgs/servers/ldap/389/default.nix +++ b/pkgs/servers/ldap/389/default.nix @@ -141,5 +141,9 @@ stdenv.mkDerivation rec { license = licenses.gpl3Plus; platforms = platforms.linux; maintainers = [ maintainers.ners ]; + # https://hydra.nixos.org/build/249763145, doesn't build since glibc 2.39. + # Potential fix is documented in https://github.com/389ds/389-ds-base/issues/5332, + # but it doesn't apply here. + broken = true; }; } diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index 5f078d2f6fcf..e32ef9bc1df6 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -6,6 +6,7 @@ , soxr, speexdsp, systemd, webrtc-audio-processing_1 , gst_all_1 , check, libintl, meson, ninja, m4, wrapGAppsHook +, fetchpatch2 , x11Support ? false @@ -48,6 +49,19 @@ stdenv.mkDerivation rec { # Install sysconfdir files inside of the nix store, # but use a conventional runtime sysconfdir outside the store ./add-option-for-installation-sysconfdir.patch + + # Fix crashes with some UCM devices + # See https://gitlab.archlinux.org/archlinux/packaging/packages/pulseaudio/-/issues/4 + (fetchpatch2 { + name = "alsa-ucm-Check-UCM-verb-before-working-with-device-status.patch"; + url = "https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/f5cacd94abcc47003bd88ad7ca1450de649ffb15.patch"; + hash = "sha256-WyEqCitrqic2n5nNHeVS10vvGy5IzwObPPXftZKy/A8="; + }) + (fetchpatch2 { + name = "alsa-ucm-Replace-port-device-UCM-context-assertion-with-an-error.patch"; + url = "https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/ed3d4f0837f670e5e5afb1afa5bcfc8ff05d3407.patch"; + hash = "sha256-fMJ3EYq56sHx+zTrG6osvI/QgnhqLvWiifZxrRLMvns="; + }) ]; outputs = [ "out" "dev" ]; diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index e2ebe4d6bbb5..b1094630dd46 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -158,8 +158,16 @@ let __stdenvImpureHostDeps = commonImpureHostDeps; __extraImpureHostDeps = commonImpureHostDeps; + # Using the bootstrap tools curl for fetchers allows the stdenv bootstrap to avoid + # having a dependency on curl, allowing curl to be updated without triggering a + # new stdenv bootstrap on Darwin. overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; + fetchpatch = super.fetchpatch.override { inherit (self) fetchurl; }; + fetchgit = super.fetchgit.override { + git = super.git.override { curl = bootstrapTools; }; + }; + fetchzip = super.fetchzip.override { inherit (self) fetchurl; }; }; }; @@ -415,8 +423,6 @@ in buildInputs = old.buildInputs ++ [ self.darwin.CF ]; }); - curl = super.curlMinimal; - # Disable tests because they use dejagnu, which fails to run. libffi = super.libffi.override { doCheck = false; }; @@ -489,8 +495,9 @@ in ''; }) - # Build sysctl and Python for use by LLVM’s check phase. These must be built in their - # own stage, or an infinite recursion results on x86_64-darwin when using the source-based SDK. + # Build cctools, Python, and sysctl for use by LLVM’s check phase. They must be built in + # their stage to prevent infinite recursions and to make sure the stdenv used to build + # LLVM has the newly built cctools instead of the one from the bootstrap tools. (prevStage: # previous stage1 stdenv: assert lib.all isFromBootstrapFiles (with prevStage; [ coreutils gnugrep ]); @@ -1027,40 +1034,11 @@ in # LLVM dependencies - don’t rebuild them. libffi libiconv libxml2 ncurses zlib; - # These overrides are required to break an infinite recursion. curl depends on Darwin - # frameworks, but those frameworks require these dependencies to build, which - # depend on curl indirectly. - cpio = super.cpio.override { - inherit (prevStage) fetchurl; - }; - - libyaml = super.libyaml.override { - inherit (prevStage) fetchFromGitHub; - }; - - pbzx = super.pbzx.override { - inherit (prevStage) fetchFromGitHub; - }; - - python3Minimal = super.python3Minimal.override { - inherit (prevStage) fetchurl; - }; - - xar = super.xar.override { - inherit (prevStage) fetchurl; - }; - darwin = super.darwin.overrideScope (selfDarwin: superDarwin: { inherit (prevStage.darwin) dyld CF Libsystem darwin-stubs # CF dependencies - don’t rebuild them. libobjc objc4; - # rewrite-tbd is also needed to build Darwin frameworks, so it’s built using the - # previous stage’s fetchFromGitHub to avoid an infinite recursion (same as above). - rewrite-tbd = superDarwin.rewrite-tbd.override { - inherit (prevStage) fetchFromGitHub; - }; - signingUtils = superDarwin.signingUtils.override { inherit (selfDarwin) sigtool; }; @@ -1075,6 +1053,28 @@ in bintools = selfDarwin.binutils-unwrapped; libc = selfDarwin.Libsystem; }; + + # cctools needs to build the LLVM man pages, which requires sphinx. Sphinx + # has hatch-vcs as a transitive dependency, which pulls in git (and curl). + # Disabling the tests for hatch-vcs allows the stdenv bootstrap to avoid having + # any dependency on curl other than the one provided in the bootstrap tools. + cctools-llvm = superDarwin.cctools-llvm.override (old: { + llvmPackages = + let + tools = old.llvmPackages.tools.extend (_: superTools: { + llvm-manpages = superTools.llvm-manpages.override { + python3Packages = prevStage.python3Packages.overrideScope (_: superPython: { + hatch-vcs = (superPython.hatch-vcs.override { + git = null; + pytestCheckHook = null; + }); + }); + }; + }); + inherit (old.llvmPackages) libraries release_version; + in + { inherit tools libraries release_version; } // tools // libraries; + }); }); llvmPackages = super.llvmPackages // ( diff --git a/pkgs/tools/X11/xdg-utils/default.nix b/pkgs/tools/X11/xdg-utils/default.nix index b9c286328a49..3a45cdffe421 100644 --- a/pkgs/tools/X11/xdg-utils/default.nix +++ b/pkgs/tools/X11/xdg-utils/default.nix @@ -1,8 +1,8 @@ -{ lib, stdenv, fetchFromGitLab, fetchFromGitHub, fetchpatch, writeText +{ lib, stdenv, fetchFromGitLab, fetchFromGitHub, writeText # docs deps , libxslt, docbook_xml_dtd_412, docbook_xml_dtd_43, docbook_xsl, xmlto # runtime deps -, resholve, bash, coreutils, dbus, file, gawk, glib, gnugrep, gnused, jq, nettools, procmail, procps, xdg-user-dirs +, resholve, bash, coreutils, dbus, file, gawk, glib, gnugrep, gnused, jq, nettools, procmail, procps, which, xdg-user-dirs , perl, perlPackages , mimiSupport ? false , withXdgOpenUsePortalPatch ? true }: @@ -212,6 +212,25 @@ let "$handler" = true; }; } + + { + scripts = [ "bin/xdg-terminal" ]; + interpreter = "${bash}/bin/bash"; + inputs = commonDeps ++ [ bash glib.bin which ]; + fake.external = commonFakes ++ [ + "gconftool-2" # GNOME + "exo-open" # XFCE + "lxterminal" # LXQT + "qterminal" # LXQT + "terminology" # Englightenment + ]; + keep = { + "$command" = true; + "$kreadconfig" = true; + "$terminal_exec" = true; + }; + prologue = commonPrologue; + } ]; in @@ -231,6 +250,8 @@ stdenv.mkDerivation rec { # Allow forcing the use of XDG portals using NIXOS_XDG_OPEN_USE_PORTAL environment variable. # Upstream PR: https://github.com/freedesktop/xdg-utils/pull/12 ./allow-forcing-portal-use.patch + # Enable build of xdg-terminal + ./enable-xdg-terminal.patch ]; # just needed when built from git diff --git a/pkgs/tools/X11/xdg-utils/enable-xdg-terminal.patch b/pkgs/tools/X11/xdg-utils/enable-xdg-terminal.patch new file mode 100644 index 000000000000..c98e3b10c6f0 --- /dev/null +++ b/pkgs/tools/X11/xdg-utils/enable-xdg-terminal.patch @@ -0,0 +1,12 @@ +--- a/scripts/Makefile.in ++++ b/scripts/Makefile.in +@@ -21,7 +21,8 @@ + xdg-open \ + xdg-email \ + xdg-screensaver \ +- xdg-settings ++ xdg-settings \ ++ xdg-terminal + # xdg-su + # xdg-copy \ + # xdg-file-dialog diff --git a/pkgs/tools/graphics/spirv-cross/default.nix b/pkgs/tools/graphics/spirv-cross/default.nix index 73413c1aee4c..c6aaf73c1eb9 100644 --- a/pkgs/tools/graphics/spirv-cross/default.nix +++ b/pkgs/tools/graphics/spirv-cross/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "spirv-cross"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "SPIRV-Cross"; rev = "vulkan-sdk-${finalAttrs.version}"; - hash = "sha256-Mhr3Yxm5MeLLQFmxWmtXLsq+ZcOE+KMs+3iiTYF8t30="; + hash = "sha256-jWTTUHUvUyF5Vern3QXZo96Yvp7/T1WQjt3OpvJczsw="; }; nativeBuildInputs = [ cmake python3 ]; diff --git a/pkgs/tools/graphics/vulkan-extension-layer/default.nix b/pkgs/tools/graphics/vulkan-extension-layer/default.nix index 336c31811aa2..7d5273b4c30c 100644 --- a/pkgs/tools/graphics/vulkan-extension-layer/default.nix +++ b/pkgs/tools/graphics/vulkan-extension-layer/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "vulkan-extension-layer"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "Vulkan-ExtensionLayer"; rev = "vulkan-sdk-${version}"; - hash = "sha256-zQycF3yKoa54KBUIuG1BqFGB00yc6oZQzdcDel2rXN0="; + hash = "sha256-THy2/hZacOI6IUPFk8cckpBKM4W3pFFeeEwSTVoMDQo="; }; nativeBuildInputs = [ cmake pkg-config jq ]; diff --git a/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix b/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix index 778b13655886..6ac7ac411185 100644 --- a/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix +++ b/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix @@ -26,13 +26,13 @@ stdenv.mkDerivation rec { pname = "vulkan-tools-lunarg"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "LunarG"; repo = "VulkanTools"; rev = "vulkan-sdk-${version}"; - hash = "sha256-MEQX90HL90jyVBWWcvOF7QLzm1+fNE5TW3MWdK4w53M="; + hash = "sha256-tp5b7/1lDF9oe/AsiqhVCvYY8p9UguGAgIkLS/hIhfQ="; }; nativeBuildInputs = [ cmake python3 jq which pkg-config libsForQt5.qt5.wrapQtAppsHook ]; diff --git a/pkgs/tools/graphics/vulkan-tools/default.nix b/pkgs/tools/graphics/vulkan-tools/default.nix index e084f7e2285b..95423b68d6b9 100644 --- a/pkgs/tools/graphics/vulkan-tools/default.nix +++ b/pkgs/tools/graphics/vulkan-tools/default.nix @@ -24,13 +24,13 @@ stdenv.mkDerivation rec { pname = "vulkan-tools"; - version = "1.3.275.0"; + version = "1.3.280.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "Vulkan-Tools"; rev = "vulkan-sdk-${version}"; - hash = "sha256-0sAwO8gXzpMst+7l7LS1oiDLo9E6otDktCti+v8jwDw="; + hash = "sha256-v6Piz1nvNffopz5FVRkgJ1pXj63jCWTyNopkpjcBFXA="; }; nativeBuildInputs = [ diff --git a/pkgs/tools/security/gnupg/24.nix b/pkgs/tools/security/gnupg/24.nix index 95a6d9c0fa5f..cc3ae15e9a1c 100644 --- a/pkgs/tools/security/gnupg/24.nix +++ b/pkgs/tools/security/gnupg/24.nix @@ -13,11 +13,11 @@ assert guiSupport -> enableMinimal == false; stdenv.mkDerivation rec { pname = "gnupg"; - version = "2.4.4"; + version = "2.4.5"; src = fetchurl { url = "mirror://gnupg/gnupg/${pname}-${version}.tar.bz2"; - hash = "sha256-Z+vgFsqQ+naIzmejh+vYLGJh6ViX23sj3yT/M1voW8Y="; + hash = "sha256-9o99ddBssWNcM2002ESvl0NsP2TqFLy3yGl4L5b0Qnc="; }; depsBuildBuild = [ buildPackages.stdenv.cc ]; diff --git a/pkgs/tools/video/svt-av1/default.nix b/pkgs/tools/video/svt-av1/default.nix index d40047510f40..d84200c3847c 100644 --- a/pkgs/tools/video/svt-av1/default.nix +++ b/pkgs/tools/video/svt-av1/default.nix @@ -4,17 +4,20 @@ , gitUpdater , cmake , nasm + +# for passthru.tests +, ffmpeg }: stdenv.mkDerivation (finalAttrs: { pname = "svt-av1"; - version = "1.8.0"; + version = "2.0.0"; src = fetchFromGitLab { owner = "AOMediaCodec"; repo = "SVT-AV1"; rev = "v${finalAttrs.version}"; - hash = "sha256-JV65VuEPJBrADsGviBnE6EgZmbqJ4Z4qli6cAfUMmkw="; + hash = "sha256-yfKnkO8GPmMpTWTVYDliERouSFgQPe3CfJmVussxfHY="; }; nativeBuildInputs = [ @@ -26,8 +29,13 @@ stdenv.mkDerivation (finalAttrs: { "-DSVT_AV1_LTO=ON" ]; - passthru.updateScript = gitUpdater { - rev-prefix = "v"; + passthru = { + updateScript = gitUpdater { + rev-prefix = "v"; + }; + tests = { + ffmpeg = ffmpeg.override { withSvtav1 = true; }; + }; }; meta = with lib; { diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index a6c98831eee6..ed34ac9a56c4 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -193,7 +193,9 @@ impure-cmds // appleSourcePackages // chooseLibs // { xcode_15 xcode_15_1 xcode; - CoreSymbolication = callPackage ../os-specific/darwin/CoreSymbolication { }; + CoreSymbolication = callPackage ../os-specific/darwin/CoreSymbolication { + inherit (apple_sdk) darwin-stubs; + }; # TODO: Remove the CF hook if a solution to the crashes is not found. CF =