diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index e4e6643dd66a..76cf6e03c257 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -175,10 +175,11 @@ buildNpmPackage rec { hash = "sha256-BR+ZGkBBfd0dSQqAvujsbgsEPFYw/ThrylxUbOksYxM="; }; - patches = [ ./remove-prepack-script.patch ]; - npmDepsHash = "sha256-tuEfyePwlOy2/mOPdXbqJskO6IowvAP4DWg8xSZwbJw="; + # The prepack script runs the build script, which we'd rather do in the build phase. + npmPackFlags = [ "--ignore-scripts" ]; + NODE_OPTIONS = "--openssl-legacy-provider"; meta = with lib; { diff --git a/doc/stdenv/stdenv.chapter.md b/doc/stdenv/stdenv.chapter.md index c28bb26baa4a..ceb3bfb5b8d0 100644 --- a/doc/stdenv/stdenv.chapter.md +++ b/doc/stdenv/stdenv.chapter.md @@ -990,6 +990,32 @@ Convenience function for `makeWrapper` that replaces `<\executable\>` with a wra If you will apply it multiple times, it will overwrite the wrapper file and you will end up with double wrapping, which should be avoided. +### `prependToVar` \ \ {#fun-prependToVar} + +Prepend elements to a variable. + +Example: + +```shellSession +$ configureFlags="--disable-static" +$ prependToVar configureFlags --disable-dependency-tracking --enable-foo +$ echo $configureFlags +--disable-dependency-tracking --enable-foo --disable-static +``` + +### `appendToVar` \ \ {#fun-appendToVar} + +Append elements to a variable. + +Example: + +```shellSession +$ configureFlags="--disable-static" +$ appendToVar configureFlags --disable-dependency-tracking --enable-foo +$ echo $configureFlags +--disable-static --disable-dependency-tracking --enable-foo +``` + ## Package setup hooks {#ssec-setup-hooks} Nix itself considers a build-time dependency as merely something that should previously be built and accessible at build time—packages themselves are on their own to perform any additional setup. In most cases, that is fine, and the downstream derivation can deal with its own dependencies. But for a few common tasks, that would result in almost every package doing the same sort of setup work—depending not on the package itself, but entirely on which dependencies were used. diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 805d54832a44..3dea20106574 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -11756,6 +11756,12 @@ githubId = 1973389; name = "Reuben D'Netto"; }; + realsnick = { + name = "Ido Samuelson"; + email = "ido.samuelson@gmail.com"; + github = "realsnick"; + githubId = 1440852; + }; redbaron = { email = "ivanov.maxim@gmail.com"; github = "redbaron"; diff --git a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml index 12e4d490300e..1014fe517db6 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml @@ -198,6 +198,17 @@ or configure your firewall. + + + llvmPackages_rocm.llvm will not contain + clang or compiler-rt. + llvmPackages_rocm.clang will not contain + llvm. + llvmPackages_rocm.clangNoCompilerRt has + been removed in favor of using + llvmPackages_rocm.clang-unwrapped. + + The Nginx module now validates the syntax of config files at @@ -255,6 +266,14 @@ that it configures the NixOS boot process, not the Nix daemon. + + + Deprecated xlibsWrapper transitional + package has been removed in favour of direct use of its + constitutents: xorg.libX11, + freetype and others. + +
@@ -445,6 +464,13 @@ system.stateVersion. + + + hip has been separated into + hip, hip-common and + hipcc. + + Resilio sync secret keys can now be provided using a secrets diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md index 07ee346c2c87..fe4eb16700da 100644 --- a/nixos/doc/manual/release-notes/rl-2305.section.md +++ b/nixos/doc/manual/release-notes/rl-2305.section.md @@ -55,6 +55,8 @@ In addition to numerous new and upgraded packages, this release has the followin - The [services.unifi-video.openFirewall](#opt-services.unifi-video.openFirewall) module option default value has been changed from `true` to `false`. You will need to explicitly set this option to `true`, or configure your firewall. +- `llvmPackages_rocm.llvm` will not contain `clang` or `compiler-rt`. `llvmPackages_rocm.clang` will not contain `llvm`. `llvmPackages_rocm.clangNoCompilerRt` has been removed in favor of using `llvmPackages_rocm.clang-unwrapped`. + - The Nginx module now validates the syntax of config files at build time. For more complex configurations (using `include` with out-of-store files notably) you may need to disable this check by setting [services.nginx.validateConfig](#opt-services.nginx.validateConfig) to `false`. - The EC2 image module previously detected and automatically mounted ext3-formatted instance store devices and partitions in stage-1 (initramfs), storing `/tmp` on the first discovered device. This behaviour, which only catered to very specific use cases and could not be disabled, has been removed. Users relying on this should provide their own implementation, and probably use ext4 and perform the mount in stage-2. @@ -67,6 +69,8 @@ In addition to numerous new and upgraded packages, this release has the followin - The `nix.readOnlyStore` option has been renamed to `boot.readOnlyNixStore` to clarify that it configures the NixOS boot process, not the Nix daemon. +- Deprecated `xlibsWrapper` transitional package has been removed in favour of direct use of its constitutents: `xorg.libX11`, `freetype` and others. + ## Other Notable Changes {#sec-release-23.05-notable-changes} @@ -119,6 +123,8 @@ In addition to numerous new and upgraded packages, this release has the followin - [Garage](https://garagehq.deuxfleurs.fr/) version is based on [system.stateVersion](options.html#opt-system.stateVersion), existing installations will keep using version 0.7. New installations will use version 0.8. In order to upgrade a Garage cluster, please follow [upstream instructions](https://garagehq.deuxfleurs.fr/documentation/cookbook/upgrading/) and force [services.garage.package](options.html#opt-services.garage.package) or upgrade accordingly [system.stateVersion](options.html#opt-system.stateVersion). +- `hip` has been separated into `hip`, `hip-common` and `hipcc`. + - Resilio sync secret keys can now be provided using a secrets file at runtime, preventing these secrets from ending up in the Nix store. - The `firewall` and `nat` module now has a nftables based implementation. Enable `networking.nftables` to use it. diff --git a/nixos/modules/config/no-x-libs.nix b/nixos/modules/config/no-x-libs.nix index 70e265a65a60..9c83a44d7b0e 100644 --- a/nixos/modules/config/no-x-libs.nix +++ b/nixos/modules/config/no-x-libs.nix @@ -33,12 +33,16 @@ with lib; ffmpeg_4 = super.ffmpeg_4-headless; ffmpeg_5 = super.ffmpeg_5-headless; gobject-introspection = super.gobject-introspection.override { x11Support = false; }; + gst_all_1 = super.gst_all_1 // { + gst-plugins-base = super.gst_all_1.gst-plugins-base.override { enableX11 = false; }; + }; gpsd = super.gpsd.override { guiSupport = false; }; imagemagick = super.imagemagick.override { libX11Support = false; libXtSupport = false; }; imagemagickBig = super.imagemagickBig.override { libX11Support = false; libXtSupport = false; }; - libextractor = super.libextractor.override { gstreamerSupport = false; gtkSupport = false; }; + libextractor = super.libextractor.override { gtkSupport = false; }; libva = super.libva-minimal; limesuite = super.limesuite.override { withGui = false; }; + mpv-unwrapped = super.mpv-unwrapped.override { sdl2Support = false; x11Support = false; }; msmtp = super.msmtp.override { withKeyring = false; }; networkmanager-fortisslvpn = super.networkmanager-fortisslvpn.override { withGnome = false; }; networkmanager-iodine = super.networkmanager-iodine.override { withGnome = false; }; diff --git a/nixos/modules/hardware/printers.nix b/nixos/modules/hardware/printers.nix index 85e3215127fd..846ff6f3fb4f 100644 --- a/nixos/modules/hardware/printers.nix +++ b/nixos/modules/hardware/printers.nix @@ -110,21 +110,26 @@ in { }; config = mkIf (cfg.ensurePrinters != [] && config.services.printing.enable) { - systemd.services.ensure-printers = let - cupsUnit = if config.services.printing.startWhenNeeded then "cups.socket" else "cups.service"; - in { + systemd.services.ensure-printers = { description = "Ensure NixOS-configured CUPS printers"; wantedBy = [ "multi-user.target" ]; - requires = [ cupsUnit ]; - after = [ cupsUnit ]; + wants = [ "cups.service" ]; + after = [ "cups.service" ]; serviceConfig = { Type = "oneshot"; RemainAfterExit = true; }; - script = concatMapStringsSep "\n" ensurePrinter cfg.ensurePrinters - + optionalString (cfg.ensureDefaultPrinter != null) (ensureDefaultPrinter cfg.ensureDefaultPrinter); + script = concatStringsSep "\n" [ + (concatMapStrings ensurePrinter cfg.ensurePrinters) + (optionalString (cfg.ensureDefaultPrinter != null) + (ensureDefaultPrinter cfg.ensureDefaultPrinter)) + # Note: if cupsd is "stateless" the service can't be stopped, + # otherwise the configuration will be wiped on the next start. + (optionalString (with config.services.printing; startWhenNeeded && !stateless) + "systemctl stop cups.service") + ]; }; }; } diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index b2e80b10fc24..dbebca815bec 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1300,6 +1300,8 @@ ./system/boot/systemd/shutdown.nix ./system/boot/systemd/tmpfiles.nix ./system/boot/systemd/user.nix + ./system/boot/systemd/userdbd.nix + ./system/boot/systemd/homed.nix ./system/boot/timesyncd.nix ./system/boot/tmp.nix ./system/boot/uvesafb.nix diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix index 273bc796341c..4224722f8792 100644 --- a/nixos/modules/security/pam.nix +++ b/nixos/modules/security/pam.nix @@ -488,6 +488,9 @@ let account [success=ok ignore=ignore default=die] ${pkgs.google-guest-oslogin}/lib/security/pam_oslogin_login.so account [success=ok default=ignore] ${pkgs.google-guest-oslogin}/lib/security/pam_oslogin_admin.so '' + + optionalString config.services.homed.enable '' + account sufficient ${config.systemd.package}/lib/security/pam_systemd_home.so + '' + # The required pam_unix.so module has to come after all the sufficient modules # because otherwise, the account lookup will fail if the user does not exist # locally, for example with MySQL- or LDAP-auth. @@ -541,8 +544,10 @@ let # after it succeeds. Certain modules need to run after pam_unix # prompts the user for password so we run it once with 'optional' at an # earlier point and it will run again with 'sufficient' further down. - # We use try_first_pass the second time to avoid prompting password twice - (optionalString (cfg.unixAuth && + # We use try_first_pass the second time to avoid prompting password twice. + # + # The same principle applies to systemd-homed + (optionalString ((cfg.unixAuth || config.services.homed.enable) && (config.security.pam.enableEcryptfs || config.security.pam.enableFscrypt || cfg.pamMount @@ -553,7 +558,10 @@ let || cfg.failDelay.enable || cfg.duoSecurity.enable)) ( - '' + optionalString config.services.homed.enable '' + auth optional ${config.systemd.package}/lib/security/pam_systemd_home.so + '' + + optionalString cfg.unixAuth '' auth optional pam_unix.so ${optionalString cfg.allowNullPassword "nullok"} ${optionalString cfg.nodelay "nodelay"} likeauth '' + optionalString config.security.pam.enableEcryptfs '' @@ -584,6 +592,9 @@ let auth required ${pkgs.duo-unix}/lib/security/pam_duo.so '' )) + + optionalString config.services.homed.enable '' + auth sufficient ${config.systemd.package}/lib/security/pam_systemd_home.so + '' + optionalString cfg.unixAuth '' auth sufficient pam_unix.so ${optionalString cfg.allowNullPassword "nullok"} ${optionalString cfg.nodelay "nodelay"} likeauth try_first_pass '' + @@ -605,6 +616,10 @@ let auth required pam_deny.so # Password management. + '' + + optionalString config.services.homed.enable '' + password sufficient ${config.systemd.package}/lib/security/pam_systemd_home.so + '' + '' password sufficient pam_unix.so nullok sha512 '' + optionalString config.security.pam.enableEcryptfs '' @@ -650,6 +665,9 @@ let ++ optional (cfg.ttyAudit.enablePattern != null) "enable=${cfg.ttyAudit.enablePattern}" ++ optional (cfg.ttyAudit.disablePattern != null) "disable=${cfg.ttyAudit.disablePattern}" )) + + optionalString config.services.homed.enable '' + session required ${config.systemd.package}/lib/security/pam_systemd_home.so + '' + optionalString cfg.makeHomeDir '' session required ${pkgs.pam}/lib/security/pam_mkhomedir.so silent skel=${config.security.pam.makeHomeDir.skelDirectory} umask=0077 '' + @@ -1361,6 +1379,9 @@ in '' + optionalString config.virtualisation.lxc.lxcfs.enable '' mr ${pkgs.lxc}/lib/security/pam_cgfs.so + '' + + optionalString config.services.homed.enable '' + mr ${config.systemd.package}/lib/security/pam_systemd_home.so ''; }; diff --git a/nixos/modules/services/networking/ircd-hybrid/builder.sh b/nixos/modules/services/networking/ircd-hybrid/builder.sh index 38312210df25..d9d2e4264dfd 100644 --- a/nixos/modules/services/networking/ircd-hybrid/builder.sh +++ b/nixos/modules/services/networking/ircd-hybrid/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup doSub() { diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix index ae59dcc226de..9ac89e057620 100644 --- a/nixos/modules/services/printing/cupsd.nix +++ b/nixos/modules/services/printing/cupsd.nix @@ -341,7 +341,7 @@ in systemd.sockets.cups = mkIf cfg.startWhenNeeded { wantedBy = [ "sockets.target" ]; - listenStreams = [ "/run/cups/cups.sock" ] + listenStreams = [ "" "/run/cups/cups.sock" ] ++ map (x: replaceStrings ["localhost"] ["127.0.0.1"] (removePrefix "*:" x)) cfg.listenAddresses; }; @@ -395,10 +395,7 @@ in ''} ''; - serviceConfig = { - PrivateTmp = true; - RuntimeDirectory = [ "cups" ]; - }; + serviceConfig.PrivateTmp = true; }; systemd.services.cups-browsed = mkIf avahiEnabled diff --git a/nixos/modules/services/web-servers/jboss/builder.sh b/nixos/modules/services/web-servers/jboss/builder.sh index 0e5af324c13f..ac573089cd5a 100644 --- a/nixos/modules/services/web-servers/jboss/builder.sh +++ b/nixos/modules/services/web-servers/jboss/builder.sh @@ -1,5 +1,6 @@ set -e +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup mkdir -p $out/bin diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index e37ed8531810..679a663362b6 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -450,7 +450,7 @@ in (mkAfter [ "systemd" ]) ]); group = (mkMerge [ - (mkAfter [ "systemd" ]) + (mkAfter [ "[success=merge] systemd" ]) # need merge so that NSS won't stop at file-based groups ]); }; diff --git a/nixos/modules/system/boot/systemd/homed.nix b/nixos/modules/system/boot/systemd/homed.nix new file mode 100644 index 000000000000..403d1690124d --- /dev/null +++ b/nixos/modules/system/boot/systemd/homed.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.services.homed; +in +{ + options.services.homed.enable = lib.mkEnableOption (lib.mdDoc '' + Enable systemd home area/user account manager + ''); + + config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = config.services.nscd.enable; + message = "systemd-homed requires the use of systemd nss module. services.nscd.enable must be set to true,"; + } + ]; + + systemd.additionalUpstreamSystemUnits = [ + "systemd-homed.service" + "systemd-homed-activate.service" + ]; + + # This is mentioned in homed's [Install] section. + # + # While homed appears to work without it, it's probably better + # to follow upstream recommendations. + services.userdbd.enable = lib.mkDefault true; + + systemd.services = { + systemd-homed = { + # These packages are required to manage encrypted volumes + path = config.system.fsPackages; + aliases = [ "dbus-org.freedesktop.home1.service" ]; + wantedBy = [ "multi-user.target" ]; + }; + + systemd-homed-activate = { + wantedBy = [ "systemd-homed.service" ]; + }; + }; + }; +} diff --git a/nixos/modules/system/boot/systemd/userdbd.nix b/nixos/modules/system/boot/systemd/userdbd.nix new file mode 100644 index 000000000000..994aa3ca3b8c --- /dev/null +++ b/nixos/modules/system/boot/systemd/userdbd.nix @@ -0,0 +1,18 @@ +{ config, lib, ... }: + +let + cfg = config.services.userdbd; +in +{ + options.services.userdbd.enable = lib.mkEnableOption (lib.mdDoc '' + Enables the systemd JSON user/group record lookup service + ''); + config = lib.mkIf cfg.enable { + systemd.additionalUpstreamSystemUnits = [ + "systemd-userdbd.socket" + "systemd-userdbd.service" + ]; + + systemd.sockets.systemd-userdbd.wantedBy = [ "sockets.target" ]; + }; +} diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 337b5192776f..ed698b63ee63 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -146,7 +146,8 @@ in rec { (onFullSupported "nixos.tests.predictable-interface-names.predictable") (onFullSupported "nixos.tests.predictable-interface-names.unpredictableNetworkd") (onFullSupported "nixos.tests.predictable-interface-names.unpredictable") - (onFullSupported "nixos.tests.printing") + (onFullSupported "nixos.tests.printing-service") + (onFullSupported "nixos.tests.printing-socket") (onFullSupported "nixos.tests.proxy") (onFullSupported "nixos.tests.sddm.default") (onFullSupported "nixos.tests.shadow") diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 83ad7c48a089..1c143602fb22 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -542,7 +542,8 @@ in { power-profiles-daemon = handleTest ./power-profiles-daemon.nix {}; pppd = handleTest ./pppd.nix {}; predictable-interface-names = handleTest ./predictable-interface-names.nix {}; - printing = handleTest ./printing.nix {}; + printing-socket = handleTest ./printing.nix { socket = true; }; + printing-service = handleTest ./printing.nix { socket = false; }; privacyidea = handleTest ./privacyidea.nix {}; privoxy = handleTest ./privoxy.nix {}; prometheus = handleTest ./prometheus.nix {}; @@ -652,6 +653,8 @@ in { systemd-shutdown = handleTest ./systemd-shutdown.nix {}; systemd-timesyncd = handleTest ./systemd-timesyncd.nix {}; systemd-misc = handleTest ./systemd-misc.nix {}; + systemd-userdbd = handleTest ./systemd-userdbd.nix {}; + systemd-homed = handleTest ./systemd-homed.nix {}; tandoor-recipes = handleTest ./tandoor-recipes.nix {}; taskserver = handleTest ./taskserver.nix {}; tayga = handleTest ./tayga.nix {}; diff --git a/nixos/tests/printing.nix b/nixos/tests/printing.nix index cfebe232d92a..7df042e72e90 100644 --- a/nixos/tests/printing.nix +++ b/nixos/tests/printing.nix @@ -1,19 +1,31 @@ # Test printing via CUPS. -import ./make-test-python.nix ({pkgs, ... }: -let - printingServer = startWhenNeeded: { - services.printing.enable = true; - services.printing.stateless = true; - services.printing.startWhenNeeded = startWhenNeeded; - services.printing.listenAddresses = [ "*:631" ]; - services.printing.defaultShared = true; - services.printing.extraConf = '' - - Order allow,deny - Allow from all - - ''; +import ./make-test-python.nix ( +{ pkgs +, socket ? true # whether to use socket activation +, ... +}: + +{ + name = "printing"; + meta = with pkgs.lib.maintainers; { + maintainers = [ domenkozar eelco matthewbauer ]; + }; + + nodes.server = { ... }: { + services.printing = { + enable = true; + stateless = true; + startWhenNeeded = socket; + listenAddresses = [ "*:631" ]; + defaultShared = true; + extraConf = '' + + Order allow,deny + Allow from all + + ''; + }; networking.firewall.allowedTCPPorts = [ 631 ]; # Add a HP Deskjet printer connected via USB to the server. hardware.printers.ensurePrinters = [{ @@ -22,32 +34,19 @@ let model = "drv:///sample.drv/deskjet.ppd"; }]; }; - printingClient = startWhenNeeded: { + + nodes.client = { ... }: { services.printing.enable = true; - services.printing.startWhenNeeded = startWhenNeeded; + services.printing.startWhenNeeded = socket; # Add printer to the client as well, via IPP. hardware.printers.ensurePrinters = [{ name = "DeskjetRemote"; - deviceUri = "ipp://${if startWhenNeeded then "socketActivatedServer" else "serviceServer"}/printers/DeskjetLocal"; + deviceUri = "ipp://server/printers/DeskjetLocal"; model = "drv:///sample.drv/deskjet.ppd"; }]; hardware.printers.ensureDefaultPrinter = "DeskjetRemote"; }; -in { - name = "printing"; - meta = with pkgs.lib.maintainers; { - maintainers = [ domenkozar eelco matthewbauer ]; - }; - - nodes = { - socketActivatedServer = { ... }: (printingServer true); - serviceServer = { ... }: (printingServer false); - - socketActivatedClient = { ... }: (printingClient true); - serviceClient = { ... }: (printingClient false); - }; - testScript = '' import os import re @@ -55,75 +54,69 @@ in { start_all() with subtest("Make sure that cups is up on both sides and printers are set up"): - serviceServer.wait_for_unit("cups.service") - serviceClient.wait_for_unit("cups.service") - socketActivatedClient.wait_for_unit("ensure-printers.service") + server.wait_for_unit("cups.${if socket then "socket" else "service"}") + client.wait_for_unit("cups.${if socket then "socket" else "service"}") + assert "scheduler is running" in client.succeed("lpstat -r") - def test_printing(client, server): - assert "scheduler is running" in client.succeed("lpstat -r") + with subtest("UNIX socket is used for connections"): + assert "/var/run/cups/cups.sock" in client.succeed("lpstat -H") - with subtest("UNIX socket is used for connections"): - assert "/var/run/cups/cups.sock" in client.succeed("lpstat -H") - with subtest("HTTP server is available too"): - client.succeed("curl --fail http://localhost:631/") - client.succeed(f"curl --fail http://{server.name}:631/") - server.fail(f"curl --fail --connect-timeout 2 http://{client.name}:631/") + with subtest("HTTP server is available too"): + client.succeed("curl --fail http://localhost:631/") + client.succeed(f"curl --fail http://{server.name}:631/") + server.fail(f"curl --fail --connect-timeout 2 http://{client.name}:631/") - with subtest("LP status checks"): - assert "DeskjetRemote accepting requests" in client.succeed("lpstat -a") - assert "DeskjetLocal accepting requests" in client.succeed( - f"lpstat -h {server.name}:631 -a" - ) - client.succeed("cupsdisable DeskjetRemote") - out = client.succeed("lpq") - print(out) - assert re.search( - "DeskjetRemote is not ready.*no entries", - client.succeed("lpq"), - flags=re.DOTALL, - ) - client.succeed("cupsenable DeskjetRemote") - assert re.match( - "DeskjetRemote is ready.*no entries", client.succeed("lpq"), flags=re.DOTALL + with subtest("LP status checks"): + assert "DeskjetRemote accepting requests" in client.succeed("lpstat -a") + assert "DeskjetLocal accepting requests" in client.succeed( + f"lpstat -h {server.name}:631 -a" + ) + client.succeed("cupsdisable DeskjetRemote") + out = client.succeed("lpq") + print(out) + assert re.search( + "DeskjetRemote is not ready.*no entries", + client.succeed("lpq"), + flags=re.DOTALL, + ) + client.succeed("cupsenable DeskjetRemote") + assert re.match( + "DeskjetRemote is ready.*no entries", client.succeed("lpq"), flags=re.DOTALL + ) + + # Test printing various file types. + for file in [ + "${pkgs.groff.doc}/share/doc/*/examples/mom/penguin.pdf", + "${pkgs.groff.doc}/share/doc/*/meref.ps", + "${pkgs.cups.out}/share/doc/cups/images/cups.png", + "${pkgs.pcre.doc}/share/doc/pcre/pcre.txt", + ]: + file_name = os.path.basename(file) + with subtest(f"print {file_name}"): + # Print the file on the client. + print(client.succeed("lpq")) + client.succeed(f"lp {file}") + client.wait_until_succeeds( + f"lpq; lpq | grep -q -E 'active.*root.*{file_name}'" ) - # Test printing various file types. - for file in [ - "${pkgs.groff.doc}/share/doc/*/examples/mom/penguin.pdf", - "${pkgs.groff.doc}/share/doc/*/meref.ps", - "${pkgs.cups.out}/share/doc/cups/images/cups.png", - "${pkgs.pcre.doc}/share/doc/pcre/pcre.txt", - ]: - file_name = os.path.basename(file) - with subtest(f"print {file_name}"): - # Print the file on the client. - print(client.succeed("lpq")) - client.succeed(f"lp {file}") - client.wait_until_succeeds( - f"lpq; lpq | grep -q -E 'active.*root.*{file_name}'" - ) + # Ensure that a raw PCL file appeared in the server's queue + # (showing that the right filters have been applied). Of + # course, since there is no actual USB printer attached, the + # file will stay in the queue forever. + server.wait_for_file("/var/spool/cups/d*-001") + server.wait_until_succeeds(f"lpq -a | grep -q -E '{file_name}'") - # Ensure that a raw PCL file appeared in the server's queue - # (showing that the right filters have been applied). Of - # course, since there is no actual USB printer attached, the - # file will stay in the queue forever. - server.wait_for_file("/var/spool/cups/d*-001") - server.wait_until_succeeds(f"lpq -a | grep -q -E '{file_name}'") + # Delete the job on the client. It should disappear on the + # server as well. + client.succeed("lprm") + client.wait_until_succeeds("lpq -a | grep -q -E 'no entries'") - # Delete the job on the client. It should disappear on the - # server as well. - client.succeed("lprm") - client.wait_until_succeeds("lpq -a | grep -q -E 'no entries'") + retry(lambda _: "no entries" in server.succeed("lpq -a")) - retry(lambda _: "no entries" in server.succeed("lpq -a")) - - # The queue is empty already, so this should be safe. - # Otherwise, pairs of "c*"-"d*-001" files might persist. - server.execute("rm /var/spool/cups/*") - - - test_printing(serviceClient, serviceServer) - test_printing(socketActivatedClient, socketActivatedServer) + # The queue is empty already, so this should be safe. + # Otherwise, pairs of "c*"-"d*-001" files might persist. + server.execute("rm /var/spool/cups/*") ''; }) diff --git a/nixos/tests/systemd-homed.nix b/nixos/tests/systemd-homed.nix new file mode 100644 index 000000000000..ecc92e98eddc --- /dev/null +++ b/nixos/tests/systemd-homed.nix @@ -0,0 +1,99 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: +let + password = "foobar"; + newPass = "barfoo"; +in +{ + name = "systemd-homed"; + nodes.machine = { config, pkgs, ... }: { + services.homed.enable = true; + + users.users.test-normal-user = { + extraGroups = [ "wheel" ]; + isNormalUser = true; + initialPassword = password; + }; + }; + testScript = '' + def switchTTY(number): + machine.send_key(f"alt-f{number}") + machine.wait_until_succeeds(f"[ $(fgconsole) = {number} ]") + machine.wait_for_unit(f"getty@tty{number}.service") + machine.wait_until_succeeds(f"pgrep -f 'agetty.*tty{number}'") + + machine.wait_for_unit("multi-user.target") + + # Smoke test to make sure the pam changes didn't break regular users. + machine.wait_until_succeeds("pgrep -f 'agetty.*tty1'") + with subtest("login as regular user"): + switchTTY(2) + machine.wait_until_tty_matches("2", "login: ") + machine.send_chars("test-normal-user\n") + machine.wait_until_tty_matches("2", "login: test-normal-user") + machine.wait_until_tty_matches("2", "Password: ") + machine.send_chars("${password}\n") + machine.wait_until_succeeds("pgrep -u test-normal-user bash") + machine.send_chars("whoami > /tmp/1\n") + machine.wait_for_file("/tmp/1") + assert "test-normal-user" in machine.succeed("cat /tmp/1") + + with subtest("create homed encrypted user"): + # TODO: Figure out how to pass password manually. + # + # This environment variable is used for homed internal testing + # and is not documented. + machine.succeed("NEWPASSWORD=${password} homectl create --shell=/run/current-system/sw/bin/bash --storage=luks -G wheel test-homed-user") + + with subtest("login as homed user"): + switchTTY(3) + machine.wait_until_tty_matches("3", "login: ") + machine.send_chars("test-homed-user\n") + machine.wait_until_tty_matches("3", "login: test-homed-user") + machine.wait_until_tty_matches("3", "Password: ") + machine.send_chars("${password}\n") + machine.wait_until_succeeds("pgrep -t tty3 -u test-homed-user bash") + machine.send_chars("whoami > /tmp/2\n") + machine.wait_for_file("/tmp/2") + assert "test-homed-user" in machine.succeed("cat /tmp/2") + + with subtest("change homed user password"): + switchTTY(4) + machine.wait_until_tty_matches("4", "login: ") + machine.send_chars("test-homed-user\n") + machine.wait_until_tty_matches("4", "login: test-homed-user") + machine.wait_until_tty_matches("4", "Password: ") + machine.send_chars("${password}\n") + machine.wait_until_succeeds("pgrep -t tty4 -u test-homed-user bash") + machine.send_chars("passwd\n") + # homed does it in a weird order, it asks for new passes, then it asks + # for the old one. + machine.sleep(2) + machine.send_chars("${newPass}\n") + machine.sleep(2) + machine.send_chars("${newPass}\n") + machine.sleep(4) + machine.send_chars("${password}\n") + machine.wait_until_fails("pgrep -t tty4 passwd") + + @polling_condition + def not_logged_in_tty5(): + machine.fail("pgrep -t tty5 bash") + + switchTTY(5) + with not_logged_in_tty5: # type: ignore[union-attr] + machine.wait_until_tty_matches("5", "login: ") + machine.send_chars("test-homed-user\n") + machine.wait_until_tty_matches("5", "login: test-homed-user") + machine.wait_until_tty_matches("5", "Password: ") + machine.send_chars("${password}\n") + machine.wait_until_tty_matches("5", "Password incorrect or not sufficient for authentication of user test-homed-user.") + machine.wait_until_tty_matches("5", "Sorry, try again: ") + machine.send_chars("${newPass}\n") + machine.send_chars("whoami > /tmp/4\n") + machine.wait_for_file("/tmp/4") + assert "test-homed-user" in machine.succeed("cat /tmp/4") + + with subtest("homed user should be in wheel according to NSS"): + machine.succeed("userdbctl group wheel -s io.systemd.NameServiceSwitch | grep test-homed-user") + ''; +}) diff --git a/nixos/tests/systemd-userdbd.nix b/nixos/tests/systemd-userdbd.nix new file mode 100644 index 000000000000..5d0233ffd9fb --- /dev/null +++ b/nixos/tests/systemd-userdbd.nix @@ -0,0 +1,32 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: { + name = "systemd-userdbd"; + nodes.machine = { config, pkgs, ... }: { + services.userdbd.enable = true; + + users.users.test-user-nss = { + isNormalUser = true; + }; + + environment.etc."userdb/test-user-dropin.user".text = builtins.toJSON { + userName = "test-user-dropin"; + }; + + environment.systemPackages = with pkgs; [ libvarlink ]; + }; + testScript = '' + import json + from shlex import quote + + def getUserRecord(name): + Interface = "unix:/run/systemd/userdb/io.systemd.Multiplexer/io.systemd.UserDatabase" + payload = json.dumps({ + "service": "io.systemd.Multiplexer", + "userName": name + }) + return json.loads(machine.succeed(f"varlink call {Interface}.GetUserRecord {quote(payload)}")) + + machine.wait_for_unit("systemd-userdbd.socket") + getUserRecord("test-user-nss") + getUserRecord("test-user-dropin") + ''; +}) diff --git a/pkgs/applications/audio/fluidsynth/default.nix b/pkgs/applications/audio/fluidsynth/default.nix index 09abaa862f51..cbed4b36181e 100644 --- a/pkgs/applications/audio/fluidsynth/default.nix +++ b/pkgs/applications/audio/fluidsynth/default.nix @@ -20,7 +20,11 @@ stdenv.mkDerivation rec { ++ lib.optionals stdenv.isLinux [ alsa-lib libpulseaudio ] ++ lib.optionals stdenv.isDarwin [ AudioUnit CoreAudio CoreMIDI CoreServices ]; - cmakeFlags = [ "-Denable-framework=off" ]; + cmakeFlags = [ + "-Denable-framework=off" + # set CMAKE_INSTALL_NAME_DIR to correct value on darwin + "-DCMAKE_INSTALL_LIBDIR=lib" + ]; meta = with lib; { description = "Real-time software synthesizer based on the SoundFont 2 specifications"; diff --git a/pkgs/applications/misc/adobe-reader/builder.sh b/pkgs/applications/misc/adobe-reader/builder.sh index 41281385c990..6047c0826430 100644 --- a/pkgs/applications/misc/adobe-reader/builder.sh +++ b/pkgs/applications/misc/adobe-reader/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup echo "unpacking $src..." diff --git a/pkgs/applications/misc/oneko/default.nix b/pkgs/applications/misc/oneko/default.nix index e0af54b1e4e6..17a94511e3fc 100644 --- a/pkgs/applications/misc/oneko/default.nix +++ b/pkgs/applications/misc/oneko/default.nix @@ -35,7 +35,5 @@ stdenv.mkDerivation rec { license = with licenses; [ publicDomain ]; maintainers = with maintainers; [ xaverdh irenes ]; platforms = platforms.unix; - # never built on aarch64-darwin since first introduction in nixpkgs - broken = stdenv.isDarwin && stdenv.isAarch64; }; } diff --git a/pkgs/applications/networking/cluster/nomad-autoscaler/default.nix b/pkgs/applications/networking/cluster/nomad-autoscaler/default.nix index 6329ff9ed11c..eb185f9743c1 100644 --- a/pkgs/applications/networking/cluster/nomad-autoscaler/default.nix +++ b/pkgs/applications/networking/cluster/nomad-autoscaler/default.nix @@ -45,7 +45,7 @@ let mv bin/nomad-autoscaler $bin/bin ln -s $bin/bin/nomad-autoscaler $out/bin/nomad-autoscaler - for d in $outputs; do + for d in $(getAllOutputNames); do mkdir -p ''${!d}/share done rmdir $bin/share diff --git a/pkgs/applications/office/libreoffice/download-list-builder.sh b/pkgs/applications/office/libreoffice/download-list-builder.sh index c054e2c72cbe..31cab28fd82e 100644 --- a/pkgs/applications/office/libreoffice/download-list-builder.sh +++ b/pkgs/applications/office/libreoffice/download-list-builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup tar --extract --file=$src libreoffice-$version/download.lst -O > $out diff --git a/pkgs/applications/science/astronomy/xearth/default.nix b/pkgs/applications/science/astronomy/xearth/default.nix index abcedf7ee7b9..bd92ae01ebb1 100644 --- a/pkgs/applications/science/astronomy/xearth/default.nix +++ b/pkgs/applications/science/astronomy/xearth/default.nix @@ -26,8 +26,6 @@ stdenv.mkDerivation rec { maintainers = [ maintainers.mafo ]; license = "xearth"; platforms=platforms.unix; - # never built on aarch64-darwin since first introduction in nixpkgs - broken = stdenv.isDarwin && stdenv.isAarch64; }; } diff --git a/pkgs/applications/terminal-emulators/alacritty/default.nix b/pkgs/applications/terminal-emulators/alacritty/default.nix index 7c0bd8b6410a..272b875cd7a8 100644 --- a/pkgs/applications/terminal-emulators/alacritty/default.nix +++ b/pkgs/applications/terminal-emulators/alacritty/default.nix @@ -60,6 +60,8 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-t6ckX0PYI8UHfXhGRpcX8ly3DzE9A6i9P6f3Ny3DBzw="; + auditable = true; # TODO: remove when this is the default + nativeBuildInputs = [ cmake installShellFiles diff --git a/pkgs/applications/version-management/commitizen/default.nix b/pkgs/applications/version-management/commitizen/default.nix index b2b459589b39..0ca00c0923b2 100644 --- a/pkgs/applications/version-management/commitizen/default.nix +++ b/pkgs/applications/version-management/commitizen/default.nix @@ -18,17 +18,18 @@ , typing-extensions , argcomplete , nix-update-script +, pre-commit }: buildPythonApplication rec { pname = "commitizen"; - version = "2.37.0"; + version = "2.38.0"; src = fetchFromGitHub { owner = "commitizen-tools"; repo = pname; rev = "v${version}"; - hash = "sha256-wo1I6QDWLxByHISmkPdass+BcKh0oxR5hD31UN/5+WQ="; + hash = "sha256-Fri5WdLfDCn3NOtCGneKnAN+eOkLAJgPYBR+WBmc/bo="; deepClone = true; }; @@ -52,6 +53,7 @@ buildPythonApplication rec { doCheck = true; checkInputs = [ + pre-commit pytestCheckHook pytest-freezegun pytest-mock diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index 2d63ae403791..56f7e697ec87 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -12,7 +12,7 @@ , withManual ? true , pythonSupport ? true , withpcre2 ? true -, sendEmailSupport ? false +, sendEmailSupport ? perlSupport , Security, CoreServices , nixosTests , withLibsecret ? false @@ -28,7 +28,7 @@ assert sendEmailSupport -> perlSupport; assert svnSupport -> perlSupport; let - version = "2.38.1"; + version = "2.39.0"; svn = subversionClient.override { perlBindings = perlSupport; }; gitwebPerlLibs = with perlPackages; [ CGI HTMLParser CGIFast FCGI FCGIProcManager HTMLTagCloud ]; in @@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchurl { url = "https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz"; - sha256 = "sha256-l9346liiueD7wlCOJFAoynWRG9ONFVFhaxSMGqV0Ctk="; + sha256 = "sha256-uhmbE/tamco97JF7C9c2vA61qd+Hc31DXt398Q1pJls="; }; outputs = [ "out" ] ++ lib.optional withManual "doc"; diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 121b50fe0f52..be2e3567da85 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -55,9 +55,9 @@ let bintoolsVersion = lib.getVersion bintools; bintoolsName = lib.removePrefix targetPrefix (lib.getName bintools); - libc_bin = if libc == null then null else getBin libc; - libc_dev = if libc == null then null else getDev libc; - libc_lib = if libc == null then null else getLib libc; + libc_bin = if libc == null then "" else getBin libc; + libc_dev = if libc == null then "" else getDev libc; + libc_lib = if libc == null then "" else getLib libc; bintools_bin = if nativeTools then "" else getBin bintools; # The wrapper scripts use 'cat' and 'grep', so we may need coreutils. coreutils_bin = if nativeTools then "" else getBin coreutils; @@ -68,7 +68,7 @@ let # The dynamic linker has different names on different platforms. This is a # shell glob that ought to match it. dynamicLinker = - /**/ if sharedLibraryLoader == null then null + /**/ if sharedLibraryLoader == null then "" else if targetPlatform.libc == "musl" then "${sharedLibraryLoader}/lib/ld-musl-*" else if targetPlatform.libc == "uclibc" then "${sharedLibraryLoader}/lib/ld*-uClibc.so.1" else if (targetPlatform.libc == "bionic" && targetPlatform.is32bit) then "/system/bin/linker" @@ -87,7 +87,7 @@ let 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 null; + else ""; expand-response-params = if buildPackages ? stdenv && buildPackages.stdenv.hasCC && buildPackages.stdenv.cc != "/dev/null" @@ -103,15 +103,10 @@ stdenv.mkDerivation { preferLocalBuild = true; - inherit bintools_bin libc_bin libc_dev libc_lib coreutils_bin; - shell = getBin shell + shell.shellPath or ""; - gnugrep_bin = if nativeTools then "" else gnugrep; - - inherit targetPrefix suffixSalt; - outputs = [ "out" ] ++ optionals propagateDoc ([ "man" ] ++ optional (bintools ? info) "info"); passthru = { + inherit targetPrefix suffixSalt; inherit bintools libc nativeTools nativeLibc nativePrefix; emacsBufferSetup = pkgs: '' @@ -193,8 +188,6 @@ stdenv.mkDerivation { strictDeps = true; depsTargetTargetPropagated = extraPackages; - wrapperName = "BINTOOLS_WRAPPER"; - setupHooks = [ ../setup-hooks/role.bash ./setup-hook.sh @@ -366,10 +359,15 @@ stdenv.mkDerivation { ## + extraBuildCommands; - inherit dynamicLinker; - - # for substitution in utils.bash - expandResponseParams = "${expand-response-params}/bin/expand-response-params"; + env = { + # for substitution in utils.bash + expandResponseParams = "${expand-response-params}/bin/expand-response-params"; + shell = getBin shell + shell.shellPath or ""; + gnugrep_bin = if nativeTools then "" else gnugrep; + wrapperName = "BINTOOLS_WRAPPER"; + inherit dynamicLinker targetPrefix suffixSalt coreutils_bin; + inherit bintools_bin libc_bin libc_dev libc_lib; + }; meta = let bintools_ = if bintools != null then bintools else {}; in diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index a59505d08258..abc88910c36d 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -42,9 +42,9 @@ let ccVersion = lib.getVersion cc; ccName = lib.removePrefix targetPrefix (lib.getName cc); - libc_bin = if libc == null then null else getBin libc; - libc_dev = if libc == null then null else getDev libc; - libc_lib = if libc == null then null else getLib libc; + libc_bin = if libc == null then "" else getBin libc; + libc_dev = if libc == null then "" else getDev libc; + libc_lib = if libc == null then "" else getLib libc; cc_solib = getLib cc + optionalString (targetPlatform != hostPlatform) "/${targetPlatform.config}"; @@ -131,22 +131,16 @@ stdenv.mkDerivation { preferLocalBuild = true; - inherit cc libc_bin libc_dev libc_lib bintools coreutils_bin; - shell = getBin shell + shell.shellPath or ""; - gnugrep_bin = if nativeTools then "" else gnugrep; - - inherit targetPrefix suffixSalt; - inherit darwinPlatformForCC darwinMinVersion darwinMinVersionVariable; - outputs = [ "out" ] ++ optionals propagateDoc [ "man" "info" ]; passthru = { + inherit targetPrefix suffixSalt; # "cc" is the generic name for a C compiler, but there is no one for package # providing the linker and related tools. The two we use now are GNU # Binutils, and Apple's "cctools"; "bintools" as an attempt to find an # unused middle-ground name that evokes both. inherit bintools; - inherit libc nativeTools nativeLibc nativePrefix isGNU isClang; + inherit cc libc nativeTools nativeLibc nativePrefix isGNU isClang; emacsBufferSetup = pkgs: '' ; We should handle propagation here too @@ -270,8 +264,6 @@ stdenv.mkDerivation { propagatedBuildInputs = [ bintools ] ++ extraTools ++ optionals cc.langD or false [ zlib ]; depsTargetTargetPropagated = optional (libcxx != null) libcxx ++ extraPackages; - wrapperName = "CC_WRAPPER"; - setupHooks = [ ../setup-hooks/role.bash ] ++ lib.optional (cc.langC or true) ./setup-hook.sh @@ -538,8 +530,16 @@ stdenv.mkDerivation { nixSupport); - # for substitution in utils.bash - expandResponseParams = "${expand-response-params}/bin/expand-response-params"; + env = { + # for substitution in utils.bash + expandResponseParams = "${expand-response-params}/bin/expand-response-params"; + shell = getBin shell + shell.shellPath or ""; + gnugrep_bin = if nativeTools then "" else gnugrep; + wrapperName = "CC_WRAPPER"; + inherit suffixSalt coreutils_bin bintools cc; + inherit libc_bin libc_dev libc_lib; + inherit darwinPlatformForCC darwinMinVersion darwinMinVersionVariable; + }; meta = let cc_ = if cc != null then cc else {}; in diff --git a/pkgs/build-support/fetchbzr/builder.sh b/pkgs/build-support/fetchbzr/builder.sh index e424fd92d51e..163f6fc60eea 100644 --- a/pkgs/build-support/fetchbzr/builder.sh +++ b/pkgs/build-support/fetchbzr/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source "$stdenv/setup" header "exporting \`$url' (revision $rev) into \`$out'" diff --git a/pkgs/build-support/fetchcvs/builder.sh b/pkgs/build-support/fetchcvs/builder.sh index fe1019aafc2f..90363275b973 100644 --- a/pkgs/build-support/fetchcvs/builder.sh +++ b/pkgs/build-support/fetchcvs/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup (echo "#!$SHELL"; \ diff --git a/pkgs/build-support/fetchdarcs/builder.sh b/pkgs/build-support/fetchdarcs/builder.sh index 301deb98307f..018852770504 100644 --- a/pkgs/build-support/fetchdarcs/builder.sh +++ b/pkgs/build-support/fetchdarcs/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup tagtext="" diff --git a/pkgs/build-support/fetchdocker/fetchdocker-builder.sh b/pkgs/build-support/fetchdocker/fetchdocker-builder.sh index 7443591e6569..e5a1a61b78d3 100644 --- a/pkgs/build-support/fetchdocker/fetchdocker-builder.sh +++ b/pkgs/build-support/fetchdocker/fetchdocker-builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source "${stdenv}/setup" header "exporting ${repository}/${imageName} (tag: ${tag}) into ${out}" mkdir -p "${out}" @@ -8,7 +9,7 @@ cat < "${out}/compositeImage.sh" # Create a tar archive of a docker image's layers, docker image config # json, manifest.json, and repositories json; this streams directly to # stdout and is intended to be used in concert with docker load, i.e: -# +# # ${out}/compositeImage.sh | docker load # The first character follow the 's' command for sed becomes the diff --git a/pkgs/build-support/fetchfossil/builder.sh b/pkgs/build-support/fetchfossil/builder.sh index 5f08aca424fe..009b23c406d6 100644 --- a/pkgs/build-support/fetchfossil/builder.sh +++ b/pkgs/build-support/fetchfossil/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup header "Cloning Fossil $url [$rev] into $out" diff --git a/pkgs/build-support/fetchgit/builder.sh b/pkgs/build-support/fetchgit/builder.sh index 66b6c168e41d..acb970639ab1 100644 --- a/pkgs/build-support/fetchgit/builder.sh +++ b/pkgs/build-support/fetchgit/builder.sh @@ -2,6 +2,8 @@ # - no revision specified and remote has a HEAD which is used # - revision specified and remote has a HEAD # - revision specified and remote without HEAD +# +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup header "exporting $url (rev $rev) into $out" diff --git a/pkgs/build-support/fetchhg/builder.sh b/pkgs/build-support/fetchhg/builder.sh index 847f18fa5975..cec0e441f229 100644 --- a/pkgs/build-support/fetchhg/builder.sh +++ b/pkgs/build-support/fetchhg/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup header "getting $url${rev:+ ($rev)} into $out" diff --git a/pkgs/build-support/fetchipfs/builder.sh b/pkgs/build-support/fetchipfs/builder.sh index 7a6a517566f5..ca77962b5384 100644 --- a/pkgs/build-support/fetchipfs/builder.sh +++ b/pkgs/build-support/fetchipfs/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup # Curl flags to handle redirects, not use EPSV, handle cookies for diff --git a/pkgs/build-support/fetchmtn/builder.sh b/pkgs/build-support/fetchmtn/builder.sh index 73eff9c27252..7db66730dab8 100644 --- a/pkgs/build-support/fetchmtn/builder.sh +++ b/pkgs/build-support/fetchmtn/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup set -x diff --git a/pkgs/build-support/fetchsvn/builder.sh b/pkgs/build-support/fetchsvn/builder.sh index ed3e65f07695..b58e5a88b3cd 100644 --- a/pkgs/build-support/fetchsvn/builder.sh +++ b/pkgs/build-support/fetchsvn/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup header "exporting $url (r$rev) into $out" diff --git a/pkgs/build-support/fetchsvnssh/builder.sh b/pkgs/build-support/fetchsvnssh/builder.sh index d9c6dc7da31a..b0441299dd2c 100644 --- a/pkgs/build-support/fetchsvnssh/builder.sh +++ b/pkgs/build-support/fetchsvnssh/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup header "exporting $url (r$rev) into $out" diff --git a/pkgs/build-support/fetchurl/builder.sh b/pkgs/build-support/fetchurl/builder.sh index 5ca09b6fc77d..dd987f41b446 100644 --- a/pkgs/build-support/fetchurl/builder.sh +++ b/pkgs/build-support/fetchurl/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup source $mirrorsFile diff --git a/pkgs/build-support/nuke-references/default.nix b/pkgs/build-support/nuke-references/default.nix index 8dd9704aa4b4..c2dfe27b2c60 100644 --- a/pkgs/build-support/nuke-references/default.nix +++ b/pkgs/build-support/nuke-references/default.nix @@ -32,8 +32,10 @@ stdenvNoCC.mkDerivation { ''; # FIXME: get rid of perl dependency. - inherit perl; - inherit (builtins) storeDir; - shell = lib.getBin shell + (shell.shellPath or ""); - signingUtils = if darwinCodeSign then signingUtils else null; + env = { + inherit perl; + inherit (builtins) storeDir; + shell = lib.getBin shell + (shell.shellPath or ""); + signingUtils = if darwinCodeSign then signingUtils else ""; + }; } diff --git a/pkgs/build-support/pkg-config-wrapper/default.nix b/pkgs/build-support/pkg-config-wrapper/default.nix index 312d2fe02610..ca14a4495fed 100644 --- a/pkgs/build-support/pkg-config-wrapper/default.nix +++ b/pkgs/build-support/pkg-config-wrapper/default.nix @@ -36,13 +36,10 @@ stdenv.mkDerivation { preferLocalBuild = true; - shell = getBin stdenvNoCC.shell + stdenvNoCC.shell.shellPath or ""; - - inherit targetPrefix suffixSalt baseBinName; - outputs = [ "out" ] ++ optionals propagateDoc ([ "man" ] ++ optional (pkg-config ? doc) "doc"); passthru = { + inherit targetPrefix suffixSalt; inherit pkg-config; }; @@ -83,8 +80,6 @@ stdenv.mkDerivation { ln -s ${pkg-config}/share $out/share ''; - wrapperName = "PKG_CONFIG_WRAPPER"; - setupHooks = [ ../setup-hooks/role.bash ./setup-hook.sh @@ -120,6 +115,12 @@ stdenv.mkDerivation { ## + extraBuildCommands; + env = { + shell = getBin stdenvNoCC.shell + stdenvNoCC.shell.shellPath or ""; + wrapperName = "PKG_CONFIG_WRAPPER"; + inherit targetPrefix suffixSalt baseBinName; + }; + meta = let pkg-config_ = if pkg-config != null then pkg-config else {}; in (if pkg-config_ ? meta then removeAttrs pkg-config.meta ["priority"] else {}) // diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix index ac51b90e0163..5ed2b0752efc 100644 --- a/pkgs/build-support/release/nix-build.nix +++ b/pkgs/build-support/release/nix-build.nix @@ -124,7 +124,7 @@ stdenv.mkDerivation ( echo "$system" > $out/nix-support/system if [ -z "${toString doingAnalysis}" ]; then - for i in $outputs; do + for i in $(getAllOutputNames); do if [ "$i" = out ]; then j=none; else j="$i"; fi mkdir -p ''${!i}/nix-support echo "nix-build $j ''${!i}" >> ''${!i}/nix-support/hydra-build-products diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 679e10a3442e..a24425bf27aa 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -5,12 +5,13 @@ , stdenv , callPackage , cacert -, git , cargoBuildHook , cargoCheckHook , cargoInstallHook , cargoNextestHook , cargoSetupHook +, cargo-auditable +, cargo-auditable-cargo-wrapper , rustc , libiconv , windows @@ -42,6 +43,8 @@ , buildFeatures ? [ ] , checkFeatures ? buildFeatures , useNextest ? false +, auditable ? false # TODO: change to true + , depsExtraArgs ? {} # Toggles whether a custom sysroot is created when the target is a .json file. @@ -115,9 +118,12 @@ stdenv.mkDerivation ((removeAttrs args [ "depsExtraArgs" "cargoUpdateHook" "carg patchRegistryDeps = ./patch-registry-deps; - nativeBuildInputs = nativeBuildInputs ++ [ + nativeBuildInputs = nativeBuildInputs ++ lib.optionals auditable [ + (cargo-auditable-cargo-wrapper.override { + inherit cargo-auditable; + }) + ] ++ [ cacert - git cargoBuildHook (if useNextest then cargoNextestHook else cargoCheckHook) cargoInstallHook @@ -126,6 +132,7 @@ stdenv.mkDerivation ((removeAttrs args [ "depsExtraArgs" "cargoUpdateHook" "carg ]; buildInputs = buildInputs + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ] ++ lib.optionals stdenv.hostPlatform.isMinGW [ windows.pthreads ]; patches = cargoPatches ++ patches; diff --git a/pkgs/build-support/setup-hooks/audit-tmpdir.sh b/pkgs/build-support/setup-hooks/audit-tmpdir.sh index c9dd32d1dd22..9c03bc2ee935 100644 --- a/pkgs/build-support/setup-hooks/audit-tmpdir.sh +++ b/pkgs/build-support/setup-hooks/audit-tmpdir.sh @@ -16,7 +16,7 @@ auditTmpdir() { header "checking for references to $TMPDIR/ in $dir..." local i - while IFS= read -r -d $'\0' i; do + find "$dir" -type f -print0 | while IFS= read -r -d $'\0' i; do if [[ "$i" =~ .build-id ]]; then continue; fi if isELF "$i"; then @@ -35,7 +35,7 @@ auditTmpdir() { fi fi - done < <(find "$dir" -type f -print0) + done stopNest } diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.sh b/pkgs/build-support/setup-hooks/auto-patchelf.sh index 7f5ff146e30b..55467b9ec7b8 100644 --- a/pkgs/build-support/setup-hooks/auto-patchelf.sh +++ b/pkgs/build-support/setup-hooks/auto-patchelf.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +# shellcheck shell=bash declare -a autoPatchelfLibs declare -a extraAutoPatchelfLibs @@ -84,7 +84,7 @@ autoPatchelf() { # (Expressions don't expand in single quotes, use double quotes for that.) postFixupHooks+=(' if [ -z "${dontAutoPatchelf-}" ]; then - autoPatchelf -- $(for output in $outputs; do + autoPatchelf -- $(for output in $(getAllOutputNames); do [ -e "${!output}" ] || continue echo "${!output}" done) diff --git a/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh b/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh index 74c8f6d0b333..83ea7de3ee21 100644 --- a/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh +++ b/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +# shellcheck shell=bash fixupOutputHooks+=('convertDesktopFiles $prefix') # Get a param out of a desktop file. First parameter is the file and the second diff --git a/pkgs/build-support/setup-hooks/make-symlinks-relative.sh b/pkgs/build-support/setup-hooks/make-symlinks-relative.sh index 0608d3ca81c4..cd9c2eaa2d80 100644 --- a/pkgs/build-support/setup-hooks/make-symlinks-relative.sh +++ b/pkgs/build-support/setup-hooks/make-symlinks-relative.sh @@ -1,4 +1,4 @@ -fixupOutputHooks+=(_makeSymlinksRelative) +postFixupHooks+=(_makeSymlinksRelative) # For every symlink in $output that refers to another file in $output # ensure that the symlink is relative. This removes references to the output diff --git a/pkgs/build-support/setup-hooks/move-docs.sh b/pkgs/build-support/setup-hooks/move-docs.sh index e4460f98816d..3f961155d201 100644 --- a/pkgs/build-support/setup-hooks/move-docs.sh +++ b/pkgs/build-support/setup-hooks/move-docs.sh @@ -1,14 +1,19 @@ -# This setup hook moves $out/{man,doc,info} to $out/share; moves -# $out/share/man to $man/share/man; and moves $out/share/doc to -# $man/share/doc. +# This setup hook moves $out/{man,doc,info} to $out/share. preFixupHooks+=(_moveToShare) _moveToShare() { - forceShare=${forceShare:=man doc info} + if [ -n "$__structuredAttrs" ]; then + if [ -z "${forceShare-}" ]; then + forceShare=( man doc info ) + fi + else + forceShare=( ${forceShare:-man doc info} ) + fi + if [[ -z "$out" ]]; then return; fi - for d in $forceShare; do + for d in "${forceShare[@]}"; do if [ -d "$out/$d" ]; then if [ -d "$out/share/$d" ]; then echo "both $d/ and share/$d/ exist!" @@ -20,4 +25,3 @@ _moveToShare() { fi done } - diff --git a/pkgs/build-support/setup-hooks/move-systemd-user-units.sh b/pkgs/build-support/setup-hooks/move-systemd-user-units.sh index 5963d87c7515..33e89898262f 100755 --- a/pkgs/build-support/setup-hooks/move-systemd-user-units.sh +++ b/pkgs/build-support/setup-hooks/move-systemd-user-units.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +# shellcheck shell=bash # This setup hook, for each output, moves everything in # $output/lib/systemd/user to $output/share/systemd/user, and replaces diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index 881cf6c90f48..8a2fc2f915e9 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -47,7 +47,7 @@ _overrideFirst outputInfo "info" "$outputBin" # Add standard flags to put files into the desired outputs. _multioutConfig() { - if [ "$outputs" = "out" ] || [ -z "${setOutputFlags-1}" ]; then return; fi; + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then return; fi; # try to detect share/doc/${shareDocName} # Note: sadly, $configureScript detection comes later in configurePhase, @@ -66,19 +66,17 @@ _multioutConfig() { fi fi - configureFlags="\ - --bindir=${!outputBin}/bin --sbindir=${!outputBin}/sbin \ - --includedir=${!outputInclude}/include --oldincludedir=${!outputInclude}/include \ - --mandir=${!outputMan}/share/man --infodir=${!outputInfo}/share/info \ - --docdir=${!outputDoc}/share/doc/${shareDocName} \ - --libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \ - --localedir=${!outputLib}/share/locale \ - $configureFlags" + prependToVar configureFlags \ + --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin \ + --includedir="${!outputInclude}"/include --oldincludedir="${!outputInclude}"/include \ + --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info \ + --docdir="${!outputDoc}"/share/doc/"${shareDocName}" \ + --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec \ + --localedir="${!outputLib}"/share/locale - installFlags="\ - pkgconfigdir=${!outputDev}/lib/pkgconfig \ - m4datadir=${!outputDev}/share/aclocal aclocaldir=${!outputDev}/share/aclocal \ - $installFlags" + prependToVar installFlags \ + pkgconfigdir="${!outputDev}"/lib/pkgconfig \ + m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal } @@ -94,7 +92,7 @@ moveToOutput() { local patt="$1" local dstOut="$2" local output - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "${!output}" = "$dstOut" ]; then continue; fi local srcPath for srcPath in "${!output}"/$patt; do @@ -149,7 +147,7 @@ _multioutDocs() { # Move development-only stuff to the desired outputs. _multioutDevs() { - if [ "$outputs" = "out" ] || [ -z "${moveToDev-1}" ]; then return; fi; + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then return; fi; moveToOutput include "${!outputInclude}" # these files are sometimes provided even without using the corresponding tool moveToOutput lib/pkgconfig "${!outputDev}" @@ -166,10 +164,10 @@ _multioutDevs() { # Make the "dev" propagate other outputs needed for development. _multioutPropagateDev() { - if [ "$outputs" = "out" ]; then return; fi; + if [ "$(getAllOutputNames)" = "out" ]; then return; fi; local outputFirst - for outputFirst in $outputs; do + for outputFirst in $(getAllOutputNames); do break done local propagaterOutput="$outputDev" diff --git a/pkgs/build-support/setup-hooks/patch-ppd-files/patch-ppd-hook.sh b/pkgs/build-support/setup-hooks/patch-ppd-files/patch-ppd-hook.sh index a450ecd7f963..77322b245b27 100644 --- a/pkgs/build-support/setup-hooks/patch-ppd-files/patch-ppd-hook.sh +++ b/pkgs/build-support/setup-hooks/patch-ppd-files/patch-ppd-hook.sh @@ -70,7 +70,7 @@ patchPpdFileCommands () { # * outputs of current build before buildInputs # * `/lib/cups/filter' before `/bin` # * add HOST_PATH at end, so we don't miss anything - for path in $outputs; do + for path in $(getAllOutputNames); do addToSearchPath cupspath "${!path}/lib/cups/filter" addToSearchPath cupspath "${!path}/bin" done diff --git a/pkgs/build-support/setup-hooks/strip.sh b/pkgs/build-support/setup-hooks/strip.sh index 9bd7b24cab54..104b5515b3db 100644 --- a/pkgs/build-support/setup-hooks/strip.sh +++ b/pkgs/build-support/setup-hooks/strip.sh @@ -12,11 +12,20 @@ _doStrip() { local -ra stripCmds=(STRIP STRIP_FOR_TARGET) local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET) + # TODO(structured-attrs): This doesn't work correctly if one of + # the items in strip*List or strip*Flags contains a space, + # even with structured attrs enabled. This is OK for now + # because very few packages set any of these, and it doesn't + # affect any of them. + # + # After __structuredAttrs = true is universal, come back and + # push arrays all the way through this logic. + # Strip only host paths by default. Leave targets as is. - stripDebugList=${stripDebugList:-lib lib32 lib64 libexec bin sbin} - stripDebugListTarget=${stripDebugListTarget:-} - stripAllList=${stripAllList:-} - stripAllListTarget=${stripAllListTarget:-} + stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin} + stripDebugListTarget=${stripDebugListTarget[*]:-} + stripAllList=${stripAllList[*]:-} + stripAllListTarget=${stripAllListTarget[*]:-} local i for i in ${!stripCmds[@]}; do @@ -30,8 +39,8 @@ _doStrip() { if [[ "${dontStrip-}" || "${flag-}" ]] || ! type -f "${stripCmd-}" 2>/dev/null then continue; fi - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags:--S}" - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags:--s}" + stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S}" + stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s}" done } diff --git a/pkgs/build-support/setup-hooks/win-dll-link.sh b/pkgs/build-support/setup-hooks/win-dll-link.sh index 6130f32bef86..ca4cbb349b6c 100644 --- a/pkgs/build-support/setup-hooks/win-dll-link.sh +++ b/pkgs/build-support/setup-hooks/win-dll-link.sh @@ -15,7 +15,7 @@ _linkDLLs() { # prefix $PATH by currently-built outputs local DLLPATH="" local outName - for outName in $outputs; do + for outName in $(getAllOutputNames); do addToSearchPath DLLPATH "${!outName}/bin" done DLLPATH="$DLLPATH:$PATH" diff --git a/pkgs/build-support/testers/expect-failure.sh b/pkgs/build-support/testers/expect-failure.sh index 0e1bbe9a678c..052ee8527176 100644 --- a/pkgs/build-support/testers/expect-failure.sh +++ b/pkgs/build-support/testers/expect-failure.sh @@ -35,7 +35,7 @@ echo "testBuildFailure: Original builder produced exit code: $r" # ----------------------------------------- # Write the build log to the default output -outs=( $outputs ) +outs=( $(getAllOutputNames) ) defOut=${outs[0]} defOutPath=${!defOut} diff --git a/pkgs/data/icons/catppuccin-cursors/default.nix b/pkgs/data/icons/catppuccin-cursors/default.nix index d9eccc96a029..4559705c169b 100644 --- a/pkgs/data/icons/catppuccin-cursors/default.nix +++ b/pkgs/data/icons/catppuccin-cursors/default.nix @@ -50,7 +50,7 @@ stdenvNoCC.mkDerivation { installPhase = '' runHook preInstall - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" != "out" ]; then local outputDir="''${!output}" local iconsDir="$outputDir"/share/icons diff --git a/pkgs/data/icons/comixcursors/default.nix b/pkgs/data/icons/comixcursors/default.nix index b63877b28209..1c4fdc195180 100644 --- a/pkgs/data/icons/comixcursors/default.nix +++ b/pkgs/data/icons/comixcursors/default.nix @@ -52,7 +52,7 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' - for outputName in $outputs ; do + for outputName in $(getAllOutputNames) ; do if [ $outputName != out ]; then local outputDir=''${!outputName}; local iconsDir=$outputDir/share/icons diff --git a/pkgs/desktops/gnome/core/gdm/default.nix b/pkgs/desktops/gnome/core/gdm/default.nix index f1fbe7e49d30..a2265387e1ef 100644 --- a/pkgs/desktops/gnome/core/gdm/default.nix +++ b/pkgs/desktops/gnome/core/gdm/default.nix @@ -143,7 +143,7 @@ stdenv.mkDerivation rec { # We use rsync to merge the directories. rsync --archive "${DESTDIR}/etc" "$out" rm --recursive "${DESTDIR}/etc" - for o in $outputs; do + for o in $(getAllOutputNames); do if [[ "$o" = "debug" ]]; then continue; fi rsync --archive "${DESTDIR}/''${!o}" "$(dirname "''${!o}")" rm --recursive "${DESTDIR}/''${!o}" diff --git a/pkgs/desktops/gnustep/make/builder.sh b/pkgs/desktops/gnustep/make/builder.sh index 39bd77038281..e5c277e796af 100644 --- a/pkgs/desktops/gnustep/make/builder.sh +++ b/pkgs/desktops/gnustep/make/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup preConfigure() { diff --git a/pkgs/development/compilers/aspectj/builder.sh b/pkgs/development/compilers/aspectj/builder.sh index 3b4393720042..7ea0a40d3748 100755 --- a/pkgs/development/compilers/aspectj/builder.sh +++ b/pkgs/development/compilers/aspectj/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup export JAVA_HOME=$jre diff --git a/pkgs/development/compilers/chicken/4/fetchegg/builder.sh b/pkgs/development/compilers/chicken/4/fetchegg/builder.sh index 204661063090..5f41a36263a9 100644 --- a/pkgs/development/compilers/chicken/4/fetchegg/builder.sh +++ b/pkgs/development/compilers/chicken/4/fetchegg/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup header "exporting egg ${eggName} (version $version) into $out" diff --git a/pkgs/development/compilers/chicken/5/fetchegg/builder.sh b/pkgs/development/compilers/chicken/5/fetchegg/builder.sh index d9adf510f22d..f02e01757787 100644 --- a/pkgs/development/compilers/chicken/5/fetchegg/builder.sh +++ b/pkgs/development/compilers/chicken/5/fetchegg/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup header "exporting egg ${eggName} (version $version) into $out" diff --git a/pkgs/development/compilers/fpc/binary-builder-darwin.sh b/pkgs/development/compilers/fpc/binary-builder-darwin.sh index f9bdf18e7d68..39db0518281d 100755 --- a/pkgs/development/compilers/fpc/binary-builder-darwin.sh +++ b/pkgs/development/compilers/fpc/binary-builder-darwin.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup pkgdir=$(pwd)/pkg diff --git a/pkgs/development/compilers/fpc/binary-builder.sh b/pkgs/development/compilers/fpc/binary-builder.sh index 4308c1ed211a..c471378c275f 100755 --- a/pkgs/development/compilers/fpc/binary-builder.sh +++ b/pkgs/development/compilers/fpc/binary-builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup tar xf $src diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index c73e9e0c1075..113bd83ea53f 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup diff --git a/pkgs/development/compilers/glslang/default.nix b/pkgs/development/compilers/glslang/default.nix index d93f647f8462..f5f46ff9f4f7 100644 --- a/pkgs/development/compilers/glslang/default.nix +++ b/pkgs/development/compilers/glslang/default.nix @@ -10,13 +10,13 @@ }: stdenv.mkDerivation rec { pname = "glslang"; - version = "1.3.231.0"; + version = "1.3.236.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "glslang"; rev = "sdk-${version}"; - hash = "sha256-huPrQr+lPi7QCF8CufAavHEKGDDimGrcskiojhH9QYk="; + hash = "sha256-iVcx1j7OMJEU4cPydNwQSFufTUiqq7GKp69Y6pEt7Wc="; }; # These get set at all-packages, keep onto them for child drvs @@ -28,12 +28,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake python3 bison jq ]; patches = [ - # https://github.com/NixOS/nixpkgs/pull/201747 - (fetchpatch { - name = "Fix-locations-of-cmake-files-in-side-compat-shims.patch"; - url = "https://github.com/KhronosGroup/glslang/commit/88fd417b0bb7d91755961c70e846d274c182f2b0.patch"; - hash = "sha256-rjeaPX5Ieem6zkICNvPd2SjvvLzG5wBERZfDLZEJsAk="; - }) (fetchpatch { name = "Use-CMAKE_INSTALL_FULL_LIBDIR-in-compat-cmake-files.patch"; url = "https://github.com/KhronosGroup/glslang/commit/7627bd89583c5aafb8b38c81c15494019271fabf.patch"; diff --git a/pkgs/development/compilers/hip-common/0000-fixup-paths.patch b/pkgs/development/compilers/hip-common/0000-fixup-paths.patch new file mode 100644 index 000000000000..f3fd73255520 --- /dev/null +++ b/pkgs/development/compilers/hip-common/0000-fixup-paths.patch @@ -0,0 +1,129 @@ +diff --git a/bin/hipcc.pl b/bin/hipcc.pl +index da9559b..7aaa540 100755 +--- a/bin/hipcc.pl ++++ b/bin/hipcc.pl +@@ -185,7 +185,7 @@ if ($HIP_PLATFORM eq "amd") { + chomp($HIP_CLANG_TARGET); + + if (! defined $HIP_CLANG_INCLUDE_PATH) { +- $HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include"); ++ $HIP_CLANG_INCLUDE_PATH = abs_path("@clang@/resource-root/include"); + } + if (! defined $HIP_INCLUDE_PATH) { + $HIP_INCLUDE_PATH = "$HIP_PATH/include"; +@@ -206,8 +206,8 @@ if ($HIP_PLATFORM eq "amd") { + print ("HIP_CLANG_TARGET=$HIP_CLANG_TARGET\n"); + } + +- $HIPCXXFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\""; +- $HIPCFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\""; ++ $HIPCXXFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH\""; ++ $HIPCFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH\""; + $HIPLDFLAGS .= " -L\"$HIP_LIB_PATH\""; + if ($isWindows) { + $HIPLDFLAGS .= " -lamdhip64"; +@@ -625,7 +625,7 @@ if($HIP_PLATFORM eq "amd"){ + $targetsStr = $ENV{HCC_AMDGPU_TARGET}; + } elsif (not $isWindows) { + # Else try using rocm_agent_enumerator +- $ROCM_AGENT_ENUM = "${ROCM_PATH}/bin/rocm_agent_enumerator"; ++ $ROCM_AGENT_ENUM = "@rocminfo@/bin/rocm_agent_enumerator"; + $targetsStr = `${ROCM_AGENT_ENUM} -t GPU`; + $targetsStr =~ s/\n/,/g; + } +@@ -724,16 +724,16 @@ if ($HIP_PLATFORM eq "amd") { + + if (not $isWindows and not $compileOnly) { + if ($linkType eq 0) { +- $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L$ROCM_PATH/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs}; ++ $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L@rocm_runtime@/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs}; + } else { + $toolArgs = ${toolArgs} . " -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 "; + } + # To support __fp16 and _Float16, explicitly link with compiler-rt +- $HIP_CLANG_BUILTIN_LIB="$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a"; ++ $HIP_CLANG_BUILTIN_LIB="@clang@/resource-root/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a"; + if (-e $HIP_CLANG_BUILTIN_LIB) { +- $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET -lclang_rt.builtins " ++ $toolArgs .= " -L@clang@/resource-root/lib/$HIP_CLANG_TARGET -lclang_rt.builtins " + } else { +- $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/linux -lclang_rt.builtins-x86_64 " ++ $toolArgs .= " -L@clang@/resource-root/lib/linux -lclang_rt.builtins-x86_64 " + } + } + } +diff --git a/bin/hipconfig.pl b/bin/hipconfig.pl +index 5ddb8e9..6a76a2e 100755 +--- a/bin/hipconfig.pl ++++ b/bin/hipconfig.pl +@@ -77,7 +77,7 @@ if ($HIP_COMPILER eq "clang") { + $CPP_CONFIG = " -D__HIP_PLATFORM_HCC__= -D__HIP_PLATFORM_AMD__="; + + $HIP_PATH_INCLUDE = $HIP_PATH."/include"; +- $HIP_CLANG_INCLUDE = $HIP_CLANG_PATH."/../lib/clang/".$HIP_CLANG_VERSION; ++ $HIP_CLANG_INCLUDE = "@clang@/resource-root/include"; + if($isWindows) { + $CPP_CONFIG .= " -I\"$HIP_PATH_INCLUDE\" -I\"$HIP_CLANG_INCLUDE\""; + } else { +@@ -168,7 +168,7 @@ if (!$printed or $p_full) { + print ("HIP_CLANG_PATH : $HIP_CLANG_PATH\n"); + if ($isWindows) { + system("\"$HIP_CLANG_PATH/clang++\" --version"); +- system("\"$HIP_CLANG_PATH/llc\" --version"); ++ system("\"@llvm@/bin/llc\" --version"); + printf("hip-clang-cxxflags : "); + $win_output = `perl \"$HIP_PATH/bin/hipcc\" --cxxflags`; + printf("$win_output \n"); +@@ -177,7 +177,7 @@ if (!$printed or $p_full) { + printf("$win_output \n"); + } else { + system("$HIP_CLANG_PATH/clang++ --version"); +- system("$HIP_CLANG_PATH/llc --version"); ++ system("@llvm@/bin/llc --version"); + print ("hip-clang-cxxflags : "); + system("$HIP_PATH/bin/hipcc --cxxflags"); + printf("\n"); +@@ -219,8 +219,8 @@ if (!$printed or $p_full) { + system ("uname -a"); + } + +- if (-e "/usr/bin/lsb_release") { +- system ("/usr/bin/lsb_release -a"); ++ if (-e "@lsb_release@/bin/lsb_release") { ++ system ("@lsb_release@/bin/lsb_release -a"); + } + + print "\n" ; +diff --git a/hip-lang-config.cmake.in b/hip-lang-config.cmake.in +index 9250a68..f6e27b7 100644 +--- a/hip-lang-config.cmake.in ++++ b/hip-lang-config.cmake.in +@@ -71,8 +71,8 @@ get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH) + + + #need _IMPORT_PREFIX to be set #FILE_REORG_BACKWARD_COMPATIBILITY +-file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "${_IMPORT_PREFIX}/../llvm/lib/clang/*/include") +-file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "${_IMPORT_PREFIX}/llvm/lib/clang/*/include") ++file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "@clang@/resource-root/include") ++file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "@clang@/resource-root/include") + find_path(HIP_CLANG_INCLUDE_PATH __clang_cuda_math.h + HINTS ${HIP_CLANG_INCLUDE_SEARCH_PATHS} + ${HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG} +@@ -89,7 +89,7 @@ find_path(HSA_HEADER hsa/hsa.h + PATHS + "${_IMPORT_PREFIX}/../include" #FILE_REORG_BACKWARD_COMPATIBILITY + "${_IMPORT_PREFIX}/include" +- "${ROCM_PATH}/include" ++ "@rocm_runtime@/include" + ) + + if (NOT HSA_HEADER) +@@ -97,7 +97,7 @@ if (NOT HSA_HEADER) + endif() + + get_filename_component(HIP_COMPILER_INSTALL_PATH ${CMAKE_HIP_COMPILER} DIRECTORY) +-file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_COMPILER_INSTALL_PATH}/../lib/clang/*/lib/*") ++file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "@clang@/resource-root/lib/*") + find_library(CLANGRT_BUILTINS + NAMES + clang_rt.builtins diff --git a/pkgs/development/compilers/hip-common/default.nix b/pkgs/development/compilers/hip-common/default.nix new file mode 100644 index 000000000000..fc5e09a45982 --- /dev/null +++ b/pkgs/development/compilers/hip-common/default.nix @@ -0,0 +1,59 @@ +{ lib +, stdenv +, fetchFromGitHub +, rocmUpdateScript +, substituteAll +, llvm +, rocm-runtime +, rocminfo +, lsb-release +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "hip-common"; + version = "5.4.1"; + + src = fetchFromGitHub { + owner = "ROCm-Developer-Tools"; + repo = "HIP"; + rev = "rocm-${finalAttrs.version}"; + hash = "sha256-JpHWTsR2Z8pXp1gNjO29pDYvH/cJvd5Dlpeig33UD28="; + }; + + patches = [ + (substituteAll { + src = ./0000-fixup-paths.patch; + inherit llvm rocminfo; + clang = stdenv.cc; + rocm_runtime = rocm-runtime; + lsb_release = lsb-release; + }) + ]; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out + mv * $out + + runHook postInstall + ''; + + passthru.updateScript = rocmUpdateScript { + name = finalAttrs.pname; + owner = finalAttrs.src.owner; + repo = finalAttrs.src.repo; + }; + + meta = with lib; { + description = "C++ Heterogeneous-Compute Interface for Portability"; + homepage = "https://github.com/ROCm-Developer-Tools/HIP"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; + platforms = platforms.linux; + broken = finalAttrs.version != stdenv.cc.version; + }; +}) diff --git a/pkgs/development/compilers/hip/0000-fixup-paths.patch b/pkgs/development/compilers/hip/0000-fixup-paths.patch new file mode 100644 index 000000000000..423857218ee7 --- /dev/null +++ b/pkgs/development/compilers/hip/0000-fixup-paths.patch @@ -0,0 +1,62 @@ +diff --git a/hip-config.cmake.in b/hip-config.cmake.in +index 89d1224..dc9ba05 100755 +--- a/hip-config.cmake.in ++++ b/hip-config.cmake.in +@@ -142,7 +142,7 @@ if(HIP_COMPILER STREQUAL "clang") + file(TO_CMAKE_PATH "${HIP_PATH}/../lc" HIP_CLANG_ROOT) + endif() + else() +- set(HIP_CLANG_ROOT "${ROCM_PATH}/llvm") ++ set(HIP_CLANG_ROOT "@clang@") + endif() + if(NOT HIP_CXX_COMPILER) + set(HIP_CXX_COMPILER ${CMAKE_CXX_COMPILER}) +@@ -171,7 +171,7 @@ if(HIP_COMPILER STREQUAL "clang") + get_filename_component(_HIP_CLANG_BIN_PATH "${_HIP_CLANG_REAL_PATH}" DIRECTORY) + get_filename_component(HIP_CLANG_ROOT "${_HIP_CLANG_BIN_PATH}" DIRECTORY) + endif() +- file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS ${HIP_CLANG_ROOT}/lib/clang/*/include) ++ file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "@clang@/resource-root/include") + find_path(HIP_CLANG_INCLUDE_PATH stddef.h + HINTS + ${HIP_CLANG_INCLUDE_SEARCH_PATHS} +@@ -209,7 +209,7 @@ if(NOT WIN32) + "${_IMPORT_PREFIX}/include" + #FILE_REORG_BACKWARD_COMPATIBILITY ${_IMPORT_PREFIX}/../include is for Backward compatibility + "${_IMPORT_PREFIX}/../include" +- ${ROCM_PATH}/include ++ "@rocm_runtime@/include" + ) + + if (NOT HSA_HEADER) +@@ -291,7 +291,7 @@ if(HIP_COMPILER STREQUAL "clang") + endif() + endif() + +- file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_CLANG_ROOT}/lib/clang/*/lib/*") ++ file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "@clang@/resource-root/lib/*") + find_library(CLANGRT_BUILTINS + NAMES + clang_rt.builtins +diff --git a/src/hip_embed_pch.sh b/src/hip_embed_pch.sh +index 0a1572b..2feb19a 100755 +--- a/src/hip_embed_pch.sh ++++ b/src/hip_embed_pch.sh +@@ -149,7 +149,7 @@ EOF + + $LLVM_DIR/bin/clang -cc1 -O3 -emit-pch -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device -std=c++17 -fgnuc-version=4.2.1 -o $tmp/hip_wave64.pch -x hip-cpp-output - <$tmp/pch_wave64.cui && + +- $LLVM_DIR/bin/llvm-mc -o hip_pch.o $tmp/hip_pch.mcin --filetype=obj && ++ @llvm@/bin/llvm-mc -o hip_pch.o $tmp/hip_pch.mcin --filetype=obj && + + rm -rf $tmp + } +@@ -195,7 +195,7 @@ EOF + set -x + $LLVM_DIR/bin/clang -O3 --rocm-path=$HIP_INC_DIR/.. -std=c++14 -nogpulib --hip-version=4.4 -isystem $HIP_INC_DIR -isystem $HIP_BUILD_INC_DIR -isystem $HIP_AMD_INC_DIR --cuda-device-only -D__HIPCC_RTC__ -x hip $tmp/hipRTC_header.h -E -o $tmp/hiprtc && + cat $macroFile >> $tmp/hiprtc && +- $LLVM_DIR/bin/llvm-mc -o $tmp/hiprtc_header.o $tmp/hipRTC_header.mcin --filetype=obj && ++ @llvm@/bin/llvm-mc -o $tmp/hiprtc_header.o $tmp/hipRTC_header.mcin --filetype=obj && + $LLVM_DIR/bin/clang $tmp/hiprtc_header.o -o $rtc_shared_lib_out -shared && + $LLVM_DIR/bin/clang -O3 --rocm-path=$HIP_INC_DIR/.. -std=c++14 -nogpulib -nogpuinc -emit-llvm -c -o $tmp/tmp.bc --cuda-device-only -D__HIPCC_RTC__ --offload-arch=gfx906 -x hip-cpp-output $tmp/hiprtc && + rm -rf $tmp diff --git a/pkgs/development/compilers/hip/default.nix b/pkgs/development/compilers/hip/default.nix index 066fd906984d..5b3d2c8e0273 100644 --- a/pkgs/development/compilers/hip/default.nix +++ b/pkgs/development/compilers/hip/default.nix @@ -1,113 +1,61 @@ -{ stdenv -, binutils-unwrapped -, clang -, cmake +{ lib +, stdenv , fetchFromGitHub , fetchpatch -, file -, lib -, libglvnd -, libX11 -, libxml2 -, llvm +, rocmUpdateScript +, substituteAll , makeWrapper -, numactl -, perl -, python3 -, python3Packages +, hip-common +, hipcc , rocclr +, roctracer +, cmake +, perl +, llvm +, rocminfo +, rocm-thunk , rocm-comgr , rocm-device-libs -, rocm-opencl-runtime , rocm-runtime -, rocm-thunk -, rocminfo -, substituteAll -, writeScript -, writeText +, rocm-opencl-runtime +, cudatoolkit +, numactl +, libxml2 +, libX11 +, libglvnd +, doxygen +, graphviz +, fontconfig +, python3Packages +, buildDocs ? true +, buildTests ? false +, useNVIDIA ? false }: let - hip = stdenv.mkDerivation (finalAttrs: { - pname = "hip"; - version = "5.4.0"; + hipPlatform = if useNVIDIA then "nvidia" else "amd"; - src = fetchFromGitHub { - owner = "ROCm-Developer-Tools"; - repo = "HIP"; - rev = "rocm-${finalAttrs.version}"; - hash = "sha256-34SJM2n3jZWIS2uwpboWOXVFhaVWGK5ELPKD/cJc1zw="; - }; + wrapperArgs = [ + "--prefix PATH : $out/bin" + "--prefix LD_LIBRARY_PATH : ${rocm-runtime}" + "--set HIP_PLATFORM ${hipPlatform}" + "--set HIP_PATH $out" + "--set HIP_CLANG_PATH ${stdenv.cc}/bin" + "--set DEVICE_LIB_PATH ${rocm-device-libs}/amdgcn/bitcode" + "--set HSA_PATH ${rocm-runtime}" + "--set ROCM_PATH $out" + ] ++ lib.optionals useNVIDIA [ + "--set CUDA_PATH ${cudatoolkit}" + ]; +in stdenv.mkDerivation (finalAttrs: { + pname = "hip-${hipPlatform}"; + version = "5.4.1"; - patches = [ - (substituteAll { - src = ./hip-config-paths.patch; - inherit llvm; - rocm_runtime = rocm-runtime; - }) - ]; - - # - fix bash paths - # - fix path to rocm_agent_enumerator - # - fix hcc path - # - fix hcc version parsing - # - add linker flags for libhsa-runtime64 and hc_am since libhip_hcc - # refers to them. - prePatch = '' - for f in $(find bin -type f); do - sed -e 's,#!/usr/bin/perl,#!${perl}/bin/perl,' \ - -e 's,#!/bin/bash,#!${stdenv.shell},' \ - -i "$f" - done - - sed 's,#!/usr/bin/python,#!${python3.interpreter},' -i hip_prof_gen.py - - sed -e 's,$ROCM_AGENT_ENUM = "''${ROCM_PATH}/bin/rocm_agent_enumerator";,$ROCM_AGENT_ENUM = "${rocminfo}/bin/rocm_agent_enumerator";,' \ - -e 's,^\($DEVICE_LIB_PATH=\).*$,\1"${rocm-device-libs}/amdgcn/bitcode";,' \ - -e 's,^\($HIP_COMPILER=\).*$,\1"clang";,' \ - -e 's,^\($HIP_RUNTIME=\).*$,\1"ROCclr";,' \ - -e 's,^\([[:space:]]*$HSA_PATH=\).*$,\1"${rocm-runtime}";,'g \ - -e 's,^\([[:space:]]*\)$HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include");,\1$HIP_CLANG_INCLUDE_PATH = "${llvm}/lib/clang/$HIP_CLANG_VERSION/include";,' \ - -e 's,^\([[:space:]]*$HIPCXXFLAGS .= " -isystem \\"$HIP_CLANG_INCLUDE_PATH/..\\"\)";,\1 -isystem ${rocm-runtime}/include";,' \ - -e 's,$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION,$HIP_CLANG_PATH/../resource-root,g' \ - -e 's,`file,`${file}/bin/file,g' \ - -e 's,`readelf,`${binutils-unwrapped}/bin/readelf,' \ - -e 's, ar , ${binutils-unwrapped}/bin/ar ,g' \ - -i bin/hipcc.pl - - sed -e 's,^\($HSA_PATH=\).*$,\1"${rocm-runtime}";,' \ - -e 's,^\($HIP_CLANG_PATH=\).*$,\1"${clang}/bin";,' \ - -e 's,^\($HIP_PLATFORM=\).*$,\1"amd";,' \ - -e 's,$HIP_CLANG_PATH/llc,${llvm}/bin/llc,' \ - -e 's, abs_path, Cwd::abs_path,' \ - -i bin/hipconfig.pl - - sed -e 's, abs_path, Cwd::abs_path,' -i bin/hipvars.pm - ''; - - buildPhase = ""; - - installPhase = '' - runHook preInstall - - mkdir -p $out - cp -r * $out/ - - runHook postInstall - ''; - - meta = with lib; { - description = "C++ Heterogeneous-Compute Interface for Portability"; - homepage = "https://github.com/ROCm-Developer-Tools/HIP"; - license = licenses.mit; - maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; - platforms = platforms.linux; - }; - }); -in -stdenv.mkDerivation (finalAttrs: { - pname = "hip"; - version = "5.4.0"; + outputs = [ + "out" + ] ++ lib.optionals buildDocs [ + "doc" + ]; src = fetchFromGitHub { owner = "ROCm-Developer-Tools"; @@ -116,105 +64,115 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-VL0vZVv099pZPX0J2pXPFvrhkVO/b6X+ZZDaD9B1hYI="; }; - nativeBuildInputs = [ cmake python3 makeWrapper perl ]; - buildInputs = [ libxml2 numactl libglvnd libX11 python3Packages.cppheaderparser ]; - propagatedBuildInputs = [ - clang - llvm - rocm-comgr - rocm-device-libs - rocm-runtime - rocm-thunk - rocminfo - ]; - patches = [ (substituteAll { - src = ./hipamd-config-paths.patch; - inherit clang llvm hip; + src = ./0000-fixup-paths.patch; + inherit llvm; + clang = stdenv.cc; rocm_runtime = rocm-runtime; }) + + # https://github.com/ROCm-Developer-Tools/hipamd/commit/be33ec55acc104a59d01df5912261d007c7f3ee9 + (fetchpatch { + url = "https://github.com/ROCm-Developer-Tools/hipamd/commit/be33ec55acc104a59d01df5912261d007c7f3ee9.patch"; + hash = "sha256-eTC4mUIN1FwRce1n38uDOlITFL/vpcOhvnaZTo5R7lo="; + }) ]; - prePatch = '' - sed -e 's,#!/bin/bash,#!${stdenv.shell},' \ - -i src/hip_embed_pch.sh - ''; + nativeBuildInputs = [ + makeWrapper + cmake + perl + python3Packages.python + python3Packages.cppheaderparser + ] ++ lib.optionals buildDocs [ + doxygen + graphviz + fontconfig + ]; - preConfigure = '' - export HIP_CLANG_PATH=${clang}/bin - export DEVICE_LIB_PATH=${rocm-device-libs}/lib - ''; + buildInputs = [ + numactl + libxml2 + libX11 + libglvnd + ]; + + propagatedBuildInputs = [ + stdenv.cc + llvm + rocminfo + rocm-thunk + rocm-comgr + rocm-device-libs + rocm-runtime + rocm-opencl-runtime + ] ++ lib.optionals useNVIDIA [ + cudatoolkit + ]; cmakeFlags = [ - "-DHIP_PLATFORM=amd" - "-DAMD_OPENCL_PATH=${rocm-opencl-runtime.src}" - "-DHIP_COMMON_DIR=${hip}" + "-DROCM_PATH=${rocminfo}" + "-DHIP_PLATFORM=${hipPlatform}" + "-DHIP_COMMON_DIR=${hip-common}" + "-DHIPCC_BIN_DIR=${hipcc}/bin" + "-DHIP_LLVM_ROOT=${stdenv.cc}" "-DROCCLR_PATH=${rocclr}" - "-DHIP_VERSION_BUILD_ID=0" + "-DAMD_OPENCL_PATH=${rocm-opencl-runtime.src}" + "-DPROF_API_HEADER_PATH=${roctracer.src}/inc/ext" # Temporarily set variables to work around upstream CMakeLists issue # Can be removed once https://github.com/ROCm-Developer-Tools/hipamd/issues/55 is fixed "-DCMAKE_INSTALL_BINDIR=bin" "-DCMAKE_INSTALL_INCLUDEDIR=include" "-DCMAKE_INSTALL_LIBDIR=lib" + ] ++ lib.optionals buildTests [ + "-DHIP_CATCH_TEST=1" ]; + postPatch = '' + export HIP_CLANG_PATH=${stdenv.cc}/bin + patchShebangs src + '' + lib.optionalString buildDocs '' + export HOME=$(mktemp -d) + export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf + ''; + + doCheck = buildTests; + checkTarget = "build_tests"; + + preCheck = lib.optionalString buildTests '' + export ROCM_PATH=$PWD + export DEVICE_LIB_PATH=${rocm-device-libs}/amdgcn/bitcode + patchShebangs bin + ''; + postInstall = '' patchShebangs $out/bin - wrapProgram $out/bin/hipcc --set HIP_PATH $out --set HSA_PATH ${rocm-runtime} --set HIP_CLANG_PATH ${clang}/bin --prefix PATH : ${llvm}/bin --set ROCM_PATH $out - wrapProgram $out/bin/hipconfig --set HIP_PATH $out --set HSA_PATH ${rocm-runtime} --set HIP_CLANG_PATH ${clang}/bin + cp -a $out/bin/hipcc $out/bin/hipcc-pl + cp -a $out/bin/hipconfig $out/bin/hipconfig-pl + wrapProgram $out/bin/hipcc --set HIP_USE_PERL_SCRIPTS 0 + wrapProgram $out/bin/hipconfig --set HIP_USE_PERL_SCRIPTS 0 + wrapProgram $out/bin/hipcc.bin ${lib.concatStringsSep " " wrapperArgs} + wrapProgram $out/bin/hipconfig.bin ${lib.concatStringsSep " " wrapperArgs} + wrapProgram $out/bin/hipcc-pl --set HIP_USE_PERL_SCRIPTS 1 + wrapProgram $out/bin/hipconfig-pl --set HIP_USE_PERL_SCRIPTS 1 + wrapProgram $out/bin/hipcc.pl ${lib.concatStringsSep " " wrapperArgs} + wrapProgram $out/bin/hipconfig.pl ${lib.concatStringsSep " " wrapperArgs} ''; - # TODO: Separate HIP and hipamd into separate derivations - passthru.updateScript = writeScript "update.sh" '' - #!/usr/bin/env nix-shell - #!nix-shell -i bash -p curl jq common-updater-scripts nix-prefetch-github - version="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ - -sL "https://api.github.com/repos/ROCm-Developer-Tools/HIP/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)" - - IFS='.' read -a version_arr <<< "$version" - - if [ "''${#version_arr[*]}" == 2 ]; then - version="''${version}.0" - fi - - current_version="$(grep "version =" pkgs/development/compilers/hip/default.nix | head -n1 | cut -d'"' -f2)" - if [[ "$version" != "$current_version" ]]; then - tarball_meta="$(nix-prefetch-github ROCm-Developer-Tools HIP --rev "rocm-$version")" - tarball_hash="$(nix to-base64 sha256-$(jq -r '.sha256' <<< "$tarball_meta"))" - sed -i -z "pkgs/development/compilers/hip/default.nix" \ - -e 's,version = "[^'"'"'"]*",version = "'"$version"'",1' \ - -e 's,hash = "[^'"'"'"]*",hash = "sha256-'"$tarball_hash"'",1' - else - echo hip already up-to-date - fi - - version="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ - -sL "https://api.github.com/repos/ROCm-Developer-Tools/hipamd/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)" - - IFS='.' read -a version_arr <<< "$version" - - if [ "''${#version_arr[*]}" == 2 ]; then - version="''${version}.0" - fi - - current_version="$(grep "version =" pkgs/development/compilers/hip/default.nix | tail -n1 | cut -d'"' -f2)" - if [[ "$version" != "$current_version" ]]; then - tarball_meta="$(nix-prefetch-github ROCm-Developer-Tools hipamd --rev "rocm-$version")" - tarball_hash="$(nix to-base64 sha256-$(jq -r '.sha256' <<< "$tarball_meta"))" - sed -i -z "pkgs/development/compilers/hip/default.nix" \ - -e 's,version = "[^'"'"'"]*",version = "'"$version"'",2' \ - -e 's,hash = "[^'"'"'"]*",hash = "sha256-'"$tarball_hash"'",2' - else - echo hipamd already up-to-date - fi - ''; + passthru.updateScript = rocmUpdateScript { + name = finalAttrs.pname; + owner = finalAttrs.src.owner; + repo = finalAttrs.src.repo; + }; meta = with lib; { - description = "C++ Heterogeneous-Compute Interface for Portability"; + description = "C++ Heterogeneous-Compute Interface for Portability specifically for AMD platform"; homepage = "https://github.com/ROCm-Developer-Tools/hipamd"; - license = licenses.mit; + license = with licenses; [ mit ]; maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; platforms = platforms.linux; + # Tests require GPU, also include issues + broken = finalAttrs.version != hip-common.version || finalAttrs.version != hipcc.version || buildTests; }; }) diff --git a/pkgs/development/compilers/hip/hip-config-paths.patch b/pkgs/development/compilers/hip/hip-config-paths.patch deleted file mode 100644 index 25fa3b8da95a..000000000000 --- a/pkgs/development/compilers/hip/hip-config-paths.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/hip-lang-config.cmake.in b/hip-lang-config.cmake.in -index 1a72643a..7f35031f 100644 ---- a/hip-lang-config.cmake.in -+++ b/hip-lang-config.cmake.in -@@ -71,8 +71,8 @@ get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH) - - - #need _IMPORT_PREFIX to be set #FILE_REORG_BACKWARD_COMPATIBILITY --file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "${_IMPORT_PREFIX}/../llvm/lib/clang/*/include") --file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "${_IMPORT_PREFIX}/llvm/lib/clang/*/include") -+file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "@llvm@/lib/clang/*/include") -+file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "@llvm@/lib/clang/*/include") - find_path(HIP_CLANG_INCLUDE_PATH __clang_cuda_math.h - HINTS ${HIP_CLANG_INCLUDE_SEARCH_PATHS} - ${HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG} -@@ -87,9 +87,7 @@ endif() - #if HSA is not under ROCm then provide CMAKE_PREFIX_PATH= - find_path(HSA_HEADER hsa/hsa.h - PATHS -- "${_IMPORT_PREFIX}/../include" #FILE_REORG_BACKWARD_COMPATIBILITY -- "${_IMPORT_PREFIX}/include" -- "${ROCM_PATH}/include" -+ "@rocm_runtime@/include" - ) - - if (NOT HSA_HEADER) -@@ -97,7 +94,7 @@ if (HSA_HEADER-NOTFOUND) - endif() - - get_filename_component(HIP_COMPILER_INSTALL_PATH ${CMAKE_HIP_COMPILER} DIRECTORY) --file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_COMPILER_INSTALL_PATH}/../lib/clang/*/lib/*") -+file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "@llvm@/lib/clang/*/lib/*") - find_library(CLANGRT_BUILTINS - NAMES - clang_rt.builtins diff --git a/pkgs/development/compilers/hip/hipamd-config-paths.patch b/pkgs/development/compilers/hip/hipamd-config-paths.patch deleted file mode 100644 index 78838836e9aa..000000000000 --- a/pkgs/development/compilers/hip/hipamd-config-paths.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/hip-config.cmake.in b/hip-config.cmake.in -index 89d1224e..120b68c6 100755 ---- a/hip-config.cmake.in -+++ b/hip-config.cmake.in -@@ -142,7 +142,7 @@ if(HIP_COMPILER STREQUAL "clang") - file(TO_CMAKE_PATH "${HIP_PATH}/../lc" HIP_CLANG_ROOT) - endif() - else() -- set(HIP_CLANG_ROOT "${ROCM_PATH}/llvm") -+ set(HIP_CLANG_ROOT "@clang@") - endif() - if(NOT HIP_CXX_COMPILER) - set(HIP_CXX_COMPILER ${CMAKE_CXX_COMPILER}) -@@ -206,10 +206,7 @@ if(NOT WIN32) - #if HSA is not under ROCm then provide CMAKE_PREFIX_PATH= - find_path(HSA_HEADER hsa/hsa.h - PATHS -- "${_IMPORT_PREFIX}/include" -- #FILE_REORG_BACKWARD_COMPATIBILITY ${_IMPORT_PREFIX}/../include is for Backward compatibility -- "${_IMPORT_PREFIX}/../include" -- ${ROCM_PATH}/include -+ "@rocm_runtime@/include" - ) - - if (NOT HSA_HEADER) -@@ -224,8 +221,8 @@ set_target_properties(hip::host PROPERTIES - - if(HIP_RUNTIME MATCHES "rocclr") - set_target_properties(hip::amdhip64 PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}" -- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${HSA_HEADER}" -+ INTERFACE_INCLUDE_DIRECTORIES "@hip@/include;${HSA_HEADER}" -+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "@hip@/include;${HSA_HEADER}" - ) - - get_target_property(amdhip64_type hip::amdhip64 TYPE) -@@ -233,8 +230,8 @@ if(HIP_RUNTIME MATCHES "rocclr") - - if(NOT WIN32) - set_target_properties(hip::device PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" -- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" -+ INTERFACE_INCLUDE_DIRECTORIES "@hip@/include" -+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "@hip@/include" - ) - endif() - endif() -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 83866d83..4125d3aa 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -178,7 +178,7 @@ if(__HIP_ENABLE_PCH) - ${ROCM_PATH}/llvm) - # find_package(LLVM) returns the lib/cmake/llvm location. We require the root. - if(NOT DEFINED HIP_LLVM_ROOT) -- set(HIP_LLVM_ROOT "${LLVM_DIR}/../../..") -+ set(HIP_LLVM_ROOT "@clang@") - endif() - - execute_process(COMMAND sh -c "${CMAKE_CURRENT_SOURCE_DIR}/hip_embed_pch.sh ${HIP_COMMON_INCLUDE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/include ${HIP_LLVM_ROOT}" COMMAND_ECHO STDERR RESULT_VARIABLE EMBED_PCH_RC) -diff --git a/src/hip_embed_pch.sh b/src/hip_embed_pch.sh -index 0a1572b2..aa855d63 100755 ---- a/src/hip_embed_pch.sh -+++ b/src/hip_embed_pch.sh -@@ -149,7 +149,7 @@ EOF - - $LLVM_DIR/bin/clang -cc1 -O3 -emit-pch -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device -std=c++17 -fgnuc-version=4.2.1 -o $tmp/hip_wave64.pch -x hip-cpp-output - <$tmp/pch_wave64.cui && - -- $LLVM_DIR/bin/llvm-mc -o hip_pch.o $tmp/hip_pch.mcin --filetype=obj && -+ @llvm@/bin/llvm-mc -o hip_pch.o $tmp/hip_pch.mcin --filetype=obj && - - rm -rf $tmp - } diff --git a/pkgs/development/compilers/hipcc/0000-fixup-paths.patch b/pkgs/development/compilers/hipcc/0000-fixup-paths.patch new file mode 100644 index 000000000000..4f52c1ad11aa --- /dev/null +++ b/pkgs/development/compilers/hipcc/0000-fixup-paths.patch @@ -0,0 +1,130 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c21f247..5bd3e45 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,6 +17,6 @@ if (NOT WIN32) # C++17 does not require the std lib linking + target_link_libraries(hipconfig.bin ${LINK_LIBS} ) # for hipconfig.bin + endif() + +-set(HIP_VERSION_MAJOR 4 PARENT_SCOPE) +-set(HIP_VERSION_MINOR 4 PARENT_SCOPE) +-set(HIP_VERSION_PATCH 4 PARENT_SCOPE) ++set(HIP_VERSION_MAJOR @version_major@) ++set(HIP_VERSION_MINOR @version_minor@) ++set(HIP_VERSION_PATCH @version_patch@) +diff --git a/src/hipBin_amd.h b/src/hipBin_amd.h +index f94e4a5..f0b1b83 100644 +--- a/src/hipBin_amd.h ++++ b/src/hipBin_amd.h +@@ -207,7 +207,7 @@ void HipBinAmd::initializeHipCXXFlags() { + hipClangIncludePath = getCompilerIncludePath(); + hipCXXFlags += " -isystem \"" + hipClangIncludePath; + fs::path hipCXXFlagsTempFs = hipCXXFlags; +- hipCXXFlagsTempFs /= "..\""; ++ hipCXXFlagsTempFs /= "\""; + hipCXXFlags = hipCXXFlagsTempFs.string(); + const EnvVariables& var = getEnvVariables(); + // Allow __fp16 as function parameter and return type. +@@ -266,7 +266,7 @@ void HipBinAmd::printCompilerInfo() const { + string cmd = hipClangPath + "/clang++ --version"; + system(cmd.c_str()); // hipclang version + cout << "llc-version :" << endl; +- cmd = hipClangPath + "/llc --version"; ++ cmd = "@llvm@/bin/llc --version"; + system(cmd.c_str()); // llc version + cout << "hip-clang-cxxflags :" << endl; + cmd = hipPath + "/bin/hipcc --cxxflags"; +@@ -278,7 +278,7 @@ void HipBinAmd::printCompilerInfo() const { + } else { + string cmd = hipClangPath + "/clang++ --version"; + system(cmd.c_str()); // hipclang version +- cmd = hipClangPath + "/llc --version"; ++ cmd = "@llvm@/bin/llc --version"; + system(cmd.c_str()); // llc version + cout << "hip-clang-cxxflags :" << endl; + cmd = hipPath + "/bin/hipcc --cxxflags"; +@@ -331,10 +331,7 @@ string HipBinAmd::getCppConfig() { + hipPathInclude /= "include"; + + const string& compilerPath = getCompilerPath(); +- hipClangInclude = compilerPath; +- hipClangInclude = hipClangInclude.parent_path(); +- hipClangInclude /= "lib/clang/"; +- hipClangInclude /= compilerVersion; ++ hipClangInclude = "@clang@/resource-root/include"; + string hipClangPath = hipClangInclude.string(); + + const OsType& osInfo = getOSInfo(); +@@ -442,17 +439,7 @@ string HipBinAmd::getHipCC() const { + + + string HipBinAmd::getCompilerIncludePath() { +- string hipClangVersion, includePath, compilerIncludePath; +- const string& hipClangPath = getCompilerPath(); +- hipClangVersion = getCompilerVersion(); +- fs::path includePathfs = hipClangPath; +- includePathfs = includePathfs.parent_path(); +- includePathfs /= "lib/clang/"; +- includePathfs /= hipClangVersion; +- includePathfs /= "include"; +- includePathfs = fs::absolute(includePathfs).string(); +- compilerIncludePath = includePathfs.string(); +- return compilerIncludePath; ++ return "@clang@/resource-root/include"; + } + + +@@ -506,8 +493,8 @@ void HipBinAmd::printFull() { + cout << endl << "== Envirnoment Variables" << endl; + printEnvironmentVariables(); + getSystemInfo(); +- if (fs::exists("/usr/bin/lsb_release")) +- system("/usr/bin/lsb_release -a"); ++ if (fs::exists("@lsb_release@/bin/lsb_release")) ++ system("@lsb_release@/bin/lsb_release -a"); + cout << endl; + } + +@@ -993,7 +980,7 @@ void HipBinAmd::executeHipCCCmd(vector argv) { + } else if (os != windows) { + // Else try using rocm_agent_enumerator + string ROCM_AGENT_ENUM; +- ROCM_AGENT_ENUM = roccmPath + "/bin/rocm_agent_enumerator"; ++ ROCM_AGENT_ENUM = "@rocminfo@/bin/rocm_agent_enumerator"; + targetsStr = ROCM_AGENT_ENUM +" -t GPU"; + SystemCmdOut sysOut = hipBinUtilPtr_->exec(targetsStr.c_str()); + regex toReplace("\n+"); +@@ -1097,7 +1084,7 @@ void HipBinAmd::executeHipCCCmd(vector argv) { + string hipClangVersion, toolArgTemp; + if (linkType == 0) { + toolArgTemp = " -L"+ hipLibPath + "-lamdhip64 -L" + +- roccmPath+ "/lib -lhsa-runtime64 -ldl -lnuma " + toolArgs; ++ "@rocm_runtime@/lib -lhsa-runtime64 -ldl -lnuma " + toolArgs; + toolArgs = toolArgTemp; + } else { + toolArgTemp = toolArgs + " -Wl,--enable-new-dtags -Wl,-rpath=" + hipLibPath + ":" +@@ -1107,8 +1094,7 @@ void HipBinAmd::executeHipCCCmd(vector argv) { + + hipClangVersion = getCompilerVersion(); + // To support __fp16 and _Float16, explicitly link with compiler-rt +- toolArgs += " -L" + hipClangPath + "/../lib/clang/" + +- hipClangVersion + "/lib/linux -lclang_rt.builtins-x86_64 "; ++ toolArgs += " -L@clang@/resource-root/lib/linux -lclang_rt.builtins-x86_64 "; + } + if (!var.hipccCompileFlagsAppendEnv_.empty()) { + HIPCXXFLAGS += " " + var.hipccCompileFlagsAppendEnv_ + " "; +diff --git a/src/hipBin_nvidia.h b/src/hipBin_nvidia.h +index 6feb315..b61739d 100644 +--- a/src/hipBin_nvidia.h ++++ b/src/hipBin_nvidia.h +@@ -157,8 +157,8 @@ void HipBinNvidia::printFull() { + cout << endl << "== Envirnoment Variables" << endl; + printEnvironmentVariables(); + getSystemInfo(); +- if (fs::exists("/usr/bin/lsb_release")) +- system("/usr/bin/lsb_release -a"); ++ if (fs::exists("@lsb_release@/bin/lsb_release")) ++ system("@lsb_release@/bin/lsb_release -a"); + } + + // returns hip include diff --git a/pkgs/development/compilers/hipcc/default.nix b/pkgs/development/compilers/hipcc/default.nix new file mode 100644 index 000000000000..8351e3a29123 --- /dev/null +++ b/pkgs/development/compilers/hipcc/default.nix @@ -0,0 +1,62 @@ +{ lib +, stdenv +, fetchFromGitHub +, rocmUpdateScript +, substituteAll +, cmake +, llvm +, rocm-runtime +, rocminfo +, lsb-release +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "hipcc"; + version = "5.4.1"; + + src = fetchFromGitHub { + owner = "ROCm-Developer-Tools"; + repo = "HIPCC"; + rev = "rocm-${finalAttrs.version}"; + hash = "sha256-PEwue4O43MiMkF8UmTeHsmlikBG2V3/nFQLKmtHrRWQ="; + }; + + patches = [ + (substituteAll { + src = ./0000-fixup-paths.patch; + inherit llvm rocminfo; + version_major = lib.versions.major finalAttrs.version; + version_minor = lib.versions.minor finalAttrs.version; + version_patch = lib.versions.patch finalAttrs.version; + clang = stdenv.cc; + rocm_runtime = rocm-runtime; + lsb_release = lsb-release; + }) + ]; + + nativeBuildInputs = [ cmake ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + mv *.bin $out/bin + + runHook postInstall + ''; + + passthru.updateScript = rocmUpdateScript { + name = finalAttrs.pname; + owner = finalAttrs.src.owner; + repo = finalAttrs.src.repo; + }; + + meta = with lib; { + description = "Compiler driver utility that calls clang or nvcc"; + homepage = "https://github.com/ROCm-Developer-Tools/HIPCC"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; + platforms = platforms.linux; + broken = finalAttrs.version != stdenv.cc.version; + }; +}) diff --git a/pkgs/development/compilers/ios-cross-compile/9.2_builder.sh b/pkgs/development/compilers/ios-cross-compile/9.2_builder.sh index 68ba3ed3a920..47459664af0a 100644 --- a/pkgs/development/compilers/ios-cross-compile/9.2_builder.sh +++ b/pkgs/development/compilers/ios-cross-compile/9.2_builder.sh @@ -1,4 +1,5 @@ # -*- shell-script -*- +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup function extract diff --git a/pkgs/development/compilers/llvm/rocm/0000-fix-openmp.patch b/pkgs/development/compilers/llvm/rocm/0000-fix-openmp.patch new file mode 100644 index 000000000000..2811df7d29f7 --- /dev/null +++ b/pkgs/development/compilers/llvm/rocm/0000-fix-openmp.patch @@ -0,0 +1,18 @@ +diff --git a/libomptarget/plugins/amdgpu/impl/impl.cpp b/libomptarget/plugins/amdgpu/impl/impl.cpp +index 80e024789..3a14e0889 100644 +--- a/libomptarget/plugins/amdgpu/impl/impl.cpp ++++ b/libomptarget/plugins/amdgpu/impl/impl.cpp +@@ -21,10 +21,11 @@ bool is_locked(void *ptr, hsa_status_t *err_p, void **agentBaseAddress) { + info.size = sizeof(hsa_amd_pointer_info_t); + err = hsa_amd_pointer_info(ptr, &info, nullptr, nullptr, nullptr); + +- if (err != HSA_STATUS_SUCCESS) ++ if (err != HSA_STATUS_SUCCESS) { + DP("Error when getting pointer info\n"); +- else ++ } else { + is_locked = (info.type == HSA_EXT_POINTER_TYPE_LOCKED); ++ } + + if (is_locked && agentBaseAddress != nullptr) { + // When user passes in a basePtr+offset we need to fix the diff --git a/pkgs/development/compilers/llvm/rocm/default.nix b/pkgs/development/compilers/llvm/rocm/default.nix index 7ff3c4bfa110..75314a4b4633 100644 --- a/pkgs/development/compilers/llvm/rocm/default.nix +++ b/pkgs/development/compilers/llvm/rocm/default.nix @@ -1,54 +1,600 @@ -{ stdenv, lib, buildPackages, fetchFromGitHub, callPackage, wrapCCWith, overrideCC }: +{ lib +, stdenv +, callPackage +, overrideCC +, wrapCCWith +, wrapBintoolsWith +, runCommand +, lit +, glibc +, spirv-llvm-translator +, xz +, swig +, lua5_3 +, gtest +, hip +, rocm-comgr +, vulkan-loader +, vulkan-headers +, glslang +, shaderc +, perl +, rocm-device-libs +, rocm-runtime +, elfutils +, python3Packages +}: let - version = "5.4.0"; - src = fetchFromGitHub { - owner = "RadeonOpenCompute"; - repo = "llvm-project"; - rev = "rocm-${version}"; - hash = "sha256-rlVo77h344PLGj/mIzsw+/ndWywsBsiKDXsEDpWSUno="; + # Stage 1 + # Base + llvm = callPackage ./llvm.nix { }; + + # Projects + clang-unwrapped = callPackage ./llvm.nix rec { + targetName = "clang"; + targetDir = targetName; + extraBuildInputs = [ llvm ]; + + extraCMakeFlags = [ + "-DCMAKE_POLICY_DEFAULT_CMP0116=NEW" + "-DCLANG_INCLUDE_DOCS=ON" + "-DCLANG_INCLUDE_TESTS=ON" + ]; + + extraPostPatch = '' + # Looks like they forgot to add finding libedit to the standalone build + ln -s ../cmake/Modules/FindLibEdit.cmake cmake/modules + + substituteInPlace CMakeLists.txt \ + --replace "include(CheckIncludeFile)" "include(CheckIncludeFile)''\nfind_package(LibEdit)" + + # `No such file or directory: '/build/source/clang/tools/scan-build/bin/scan-build'` + rm test/Analysis/scan-build/*.test + rm test/Analysis/scan-build/rebuild_index/rebuild_index.test + + # `does not depend on a module exporting 'baz.h'` + rm test/Modules/header-attribs.cpp + + # `fatal error: 'stdio.h' file not found` + rm test/OpenMP/amdgcn_emit_llvm.c + ''; + + extraPostInstall = '' + mv bin/clang-tblgen $out/bin + ''; }; + + lld = callPackage ./llvm.nix rec { + buildMan = false; # No man pages to build + targetName = "lld"; + targetDir = targetName; + extraBuildInputs = [ llvm ]; + extraCMakeFlags = [ "-DCMAKE_POLICY_DEFAULT_CMP0116=NEW" ]; + checkTargets = [ "check-lld" ]; + }; + + # Runtimes + runtimes = callPackage ./llvm.nix { + buildDocs = false; + buildMan = false; + buildTests = false; + targetDir = "runtimes"; + + targetRuntimes = [ + # "libc" https://github.com/llvm/llvm-project/issues/57719 + "libunwind" + "libcxxabi" + "libcxx" + "compiler-rt" + ]; + + extraBuildInputs = [ llvm ]; + + extraCMakeFlags = [ + "-DCMAKE_POLICY_DEFAULT_CMP0114=NEW" + "-DLIBCXX_INCLUDE_BENCHMARKS=OFF" + "-DLIBCXX_CXX_ABI=libcxxabi" + ]; + + extraLicenses = [ lib.licenses.mit ]; + }; + + # Stage 2 + # Helpers + rStdenv = overrideCC stdenv (wrapCCWith rec { + inherit bintools; + libcxx = runtimes; + cc = clang-unwrapped; + + extraPackages = [ + llvm + lld + ]; + + nixSupport.cc-cflags = [ + "-resource-dir=$out/resource-root" + "-fuse-ld=lld" + "-rtlib=compiler-rt" + "-unwindlib=libunwind" + "-Wno-unused-command-line-argument" + ]; + + extraBuildCommands = '' + clang_version=`${cc}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"` + mkdir -p $out/resource-root + ln -s ${cc}/lib/clang/$clang_version/include $out/resource-root + ln -s ${runtimes}/lib $out/resource-root + ''; + }); + + bintools = wrapBintoolsWith { bintools = bintools-unwrapped; }; + + bintools-unwrapped = runCommand "rocm-llvm-binutils-${llvm.version}" { preferLocalBuild = true; } '' + mkdir -p $out/bin + + for prog in ${lld}/bin/*; do + ln -s $prog $out/bin/$(basename $prog) + done + + for prog in ${llvm}/bin/*; do + ln -sf $prog $out/bin/$(basename $prog) + done + + ln -s ${llvm}/bin/llvm-ar $out/bin/ar + ln -s ${llvm}/bin/llvm-as $out/bin/as + ln -s ${llvm}/bin/llvm-dwp $out/bin/dwp + ln -s ${llvm}/bin/llvm-nm $out/bin/nm + ln -s ${llvm}/bin/llvm-objcopy $out/bin/objcopy + ln -s ${llvm}/bin/llvm-objdump $out/bin/objdump + ln -s ${llvm}/bin/llvm-ranlib $out/bin/ranlib + ln -s ${llvm}/bin/llvm-readelf $out/bin/readelf + ln -s ${llvm}/bin/llvm-size $out/bin/size + ln -s ${llvm}/bin/llvm-strip $out/bin/strip + ln -s ${lld}/bin/lld $out/bin/ld + ''; in rec { + inherit + llvm + clang-unwrapped + lld + bintools + bintools-unwrapped; + + # Runtimes + libc = callPackage ./llvm.nix rec { + stdenv = rStdenv; + targetName = "libc"; + targetDir = "runtimes"; + targetRuntimes = [ targetName ]; + isBroken = true; # https://github.com/llvm/llvm-project/issues/57719 + }; + + libunwind = callPackage ./llvm.nix rec { + stdenv = rStdenv; + buildMan = false; # No man pages to build + targetName = "libunwind"; + targetDir = "runtimes"; + targetRuntimes = [ targetName ]; + + extraCMakeFlags = [ + "-DLIBUNWIND_INCLUDE_DOCS=ON" + "-DLIBUNWIND_INCLUDE_TESTS=ON" + "-DLIBUNWIND_USE_COMPILER_RT=ON" + ]; + }; + + libcxxabi = callPackage ./llvm.nix rec { + stdenv = rStdenv; + buildDocs = false; # No documentation to build + buildMan = false; # No man pages to build + targetName = "libcxxabi"; + targetDir = "runtimes"; + + targetRuntimes = [ + "libunwind" + targetName + "libcxx" + ]; + + extraCMakeFlags = [ + "-DLIBCXXABI_INCLUDE_TESTS=ON" + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + "-DLIBCXXABI_USE_COMPILER_RT=ON" + + # Workaround having to build combined + "-DLIBUNWIND_INCLUDE_DOCS=OFF" + "-DLIBUNWIND_INCLUDE_TESTS=OFF" + "-DLIBUNWIND_USE_COMPILER_RT=ON" + "-DLIBUNWIND_INSTALL_LIBRARY=OFF" + "-DLIBUNWIND_INSTALL_HEADERS=OFF" + "-DLIBCXX_INCLUDE_DOCS=OFF" + "-DLIBCXX_INCLUDE_TESTS=OFF" + "-DLIBCXX_USE_COMPILER_RT=ON" + "-DLIBCXX_CXX_ABI=libcxxabi" + "-DLIBCXX_INSTALL_LIBRARY=OFF" + "-DLIBCXX_INSTALL_HEADERS=OFF" + ]; + }; + + libcxx = callPackage ./llvm.nix rec { + stdenv = rStdenv; + buildMan = false; # No man pages to build + targetName = "libcxx"; + targetDir = "runtimes"; + + targetRuntimes = [ + "libunwind" + "libcxxabi" + targetName + ]; + + extraCMakeFlags = [ + "-DLIBCXX_INCLUDE_DOCS=ON" + "-DLIBCXX_INCLUDE_TESTS=ON" + "-DLIBCXX_USE_COMPILER_RT=ON" + "-DLIBCXX_CXX_ABI=libcxxabi" + + # Workaround having to build combined + "-DLIBUNWIND_INCLUDE_DOCS=OFF" + "-DLIBUNWIND_INCLUDE_TESTS=OFF" + "-DLIBUNWIND_USE_COMPILER_RT=ON" + "-DLIBUNWIND_INSTALL_LIBRARY=OFF" + "-DLIBUNWIND_INSTALL_HEADERS=OFF" + "-DLIBCXXABI_INCLUDE_TESTS=OFF" + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + "-DLIBCXXABI_USE_COMPILER_RT=ON" + "-DLIBCXXABI_INSTALL_LIBRARY=OFF" + "-DLIBCXXABI_INSTALL_HEADERS=OFF" + ]; + + # Most of these can't find `bash` or `mkdir`, might just be hard-coded paths, or PATH is altered + extraPostPatch = '' + chmod +w -R ../libcxx/test/{libcxx,std} + rm -rf ../libcxx/test/libcxx/input.output/filesystems + rm ../libcxx/test/libcxx/selftest/remote-substitutions.sh.cpp + rm ../libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp + rm ../libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp + rm ../libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp + rm ../libcxx/test/std/utilities/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp + rm -rf ../libcxx/test/std/utilities/optional/optional.object/optional.object.ctor + rm -rf ../libcxx/test/std/input.output/filesystems/{class.directory_entry,class.directory_iterator,class.rec.dir.itr,fs.op.funcs} + ''; + }; + + compiler-rt = callPackage ./llvm.nix rec { + stdenv = rStdenv; + buildDocs = false; # No documentation to build + buildMan = false; # No man pages to build + targetName = "compiler-rt"; + targetDir = "runtimes"; + + targetRuntimes = [ + "libunwind" + "libcxxabi" + "libcxx" + targetName + ]; + + extraCMakeFlags = [ + "-DCMAKE_POLICY_DEFAULT_CMP0114=NEW" + "-DCOMPILER_RT_INCLUDE_TESTS=ON" + "-DCOMPILER_RT_USE_LLVM_UNWINDER=ON" + "-DCOMPILER_RT_CXX_LIBRARY=libcxx" + "-DCOMPILER_RT_CAN_EXECUTE_TESTS=OFF" # We can't run most of these + + # Workaround having to build combined + "-DLIBUNWIND_INCLUDE_DOCS=OFF" + "-DLIBUNWIND_INCLUDE_TESTS=OFF" + "-DLIBUNWIND_USE_COMPILER_RT=ON" + "-DLIBUNWIND_INSTALL_LIBRARY=OFF" + "-DLIBUNWIND_INSTALL_HEADERS=OFF" + "-DLIBCXXABI_INCLUDE_TESTS=OFF" + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + "-DLIBCXXABI_USE_COMPILER_RT=ON" + "-DLIBCXXABI_INSTALL_LIBRARY=OFF" + "-DLIBCXXABI_INSTALL_HEADERS=OFF" + "-DLIBCXX_INCLUDE_DOCS=OFF" + "-DLIBCXX_INCLUDE_TESTS=OFF" + "-DLIBCXX_USE_COMPILER_RT=ON" + "-DLIBCXX_CXX_ABI=libcxxabi" + "-DLIBCXX_INSTALL_LIBRARY=OFF" + "-DLIBCXX_INSTALL_HEADERS=OFF" + ]; + + extraPostPatch = '' + # `No such file or directory: 'ldd'` + substituteInPlace ../compiler-rt/test/lit.common.cfg.py \ + --replace "'ldd'," "'${glibc.bin}/bin/ldd'," + + # We can run these + substituteInPlace ../compiler-rt/test/CMakeLists.txt \ + --replace "endfunction()" "endfunction()''\nadd_subdirectory(builtins)''\nadd_subdirectory(shadowcallstack)" + ''; + + extraLicenses = [ lib.licenses.mit ]; + }; + + # Stage 3 + # Helpers + rocmClangStdenv = overrideCC stdenv clang; + clang = wrapCCWith rec { - cc = llvm; + # inherit libc libcxx bintools; + inherit libcxx bintools; + + # We do this to avoid HIP pathing problems, and mimic a monolithic install + cc = stdenv.mkDerivation (finalAttrs: { + inherit (clang-unwrapped) pname version; + dontUnpack = true; + + installPhase = '' + runHook preInstall + + clang_version=`${clang-unwrapped}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"` + mkdir -p $out/{bin,include/c++/v1,lib/{cmake,clang/$clang_version/{include,lib}},libexec,share} + + for path in ${llvm} ${clang-unwrapped} ${lld} ${libunwind} ${libcxxabi} ${libcxx} ${compiler-rt}; do + cp -as $path/* $out + chmod +w $out/{*,include/c++/v1,lib/{clang/$clang_version/include,cmake}} + rm -f $out/lib/libc++.so + done + + ln -s $out/lib/* $out/lib/clang/$clang_version/lib + ln -s $out/include/* $out/lib/clang/$clang_version/include + + runHook postInstall + ''; + + passthru.isClang = true; + }); + + extraPackages = [ + llvm + lld + libunwind + libcxxabi + compiler-rt + ]; + + nixSupport.cc-cflags = [ + "-resource-dir=$out/resource-root" + "-fuse-ld=lld" + "-rtlib=compiler-rt" + "-unwindlib=libunwind" + "-Wno-unused-command-line-argument" + ]; + extraBuildCommands = '' clang_version=`${cc}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"` - rsrc="$out/resource-root" - mkdir "$rsrc" - ln -s "${cc}/lib/clang/$clang_version/include" "$rsrc" - ln -s "${cc}/lib/clang/$clang_version/lib" "$rsrc/lib" - echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags - echo "--gcc-toolchain=${stdenv.cc.cc}" >> $out/nix-support/cc-cflags + mkdir -p $out/resource-root + ln -s ${cc}/lib/clang/$clang_version/{include,lib} $out/resource-root + + # Not sure why, but hardening seems to make things break rm $out/nix-support/add-hardening.sh touch $out/nix-support/add-hardening.sh - # GPU compilation uses builtin lld - substituteInPlace $out/bin/clang \ - --replace '-MM) dontLink=1 ;;' $'-MM | --cuda-device-only) dontLink=1 ;;\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;' - substituteInPlace $out/bin/clang++ \ - --replace '-MM) dontLink=1 ;;' $'-MM | --cuda-device-only) dontLink=1 ;;\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;' + + # GPU compilation uses builtin `lld` + substituteInPlace $out/bin/{clang,clang++} \ + --replace "-MM) dontLink=1 ;;" "-MM | --cuda-device-only) dontLink=1 ;;''\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;" ''; }; - clangNoCompilerRt = wrapCCWith rec { - cc = llvm; - extraBuildCommands = '' - clang_version=`${cc}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"` - rsrc="$out/resource-root" - mkdir "$rsrc" - ln -s "${cc}/lib/clang/$clang_version/include" "$rsrc" - echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags - echo "--gcc-toolchain=${stdenv.cc.cc}" >> $out/nix-support/cc-cflags - rm $out/nix-support/add-hardening.sh - touch $out/nix-support/add-hardening.sh - # GPU compilation uses builtin lld - substituteInPlace $out/bin/clang \ - --replace '-MM) dontLink=1 ;;' $'-MM | --cuda-device-only) dontLink=1 ;;\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;' - substituteInPlace $out/bin/clang++ \ - --replace '-MM) dontLink=1 ;;' $'-MM | --cuda-device-only) dontLink=1 ;;\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;' + # Base + # Unfortunately, we cannot build `clang-tools-extra` separately. + clang-tools-extra = callPackage ./llvm.nix { + stdenv = rocmClangStdenv; + buildTests = false; # `invalid operands to binary expression ('std::basic_stringstream' and 'const llvm::StringRef')` + targetName = "clang-tools-extra"; + + targetProjects = [ + "clang" + "clang-tools-extra" + ]; + + extraBuildInputs = [ gtest ]; + + extraCMakeFlags = [ + "-DLLVM_INCLUDE_DOCS=OFF" + "-DLLVM_INCLUDE_TESTS=OFF" + "-DCLANG_INCLUDE_DOCS=OFF" + "-DCLANG_INCLUDE_TESTS=ON" + "-DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=ON" + ]; + + extraPostInstall = '' + # Remove LLVM and Clang + for path in `find ${llvm} ${clang-unwrapped}`; do + if [ $path != ${llvm} ] && [ $path != ${clang-unwrapped} ]; then + rm -f $out''${path#${llvm}} $out''${path#${clang-unwrapped}} || true + fi + done + + # Cleanup empty directories + find $out -type d -empty -delete ''; }; - llvm = callPackage ./llvm.nix { - inherit src version; + # Projects + libclc = let + spirv = (spirv-llvm-translator.override { inherit llvm; }); + in callPackage ./llvm.nix rec { + stdenv = rocmClangStdenv; + buildDocs = false; # No documentation to build + buildMan = false; # No man pages to build + targetName = "libclc"; + targetDir = targetName; + extraBuildInputs = [ spirv ]; + + # `spirv-mesa3d` isn't compiling with LLVM 15.0.0, it does with LLVM 14.0.0 + # Try removing the `spirv-mesa3d` and `clspv` patches next update + # `clspv` tests fail, unresolved calls + extraPostPatch = '' + substituteInPlace CMakeLists.txt \ + --replace "find_program( LLVM_CLANG clang PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ + "find_program( LLVM_CLANG clang PATHS \"${clang}/bin\" NO_DEFAULT_PATH )" \ + --replace "find_program( LLVM_SPIRV llvm-spirv PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ + "find_program( LLVM_SPIRV llvm-spirv PATHS \"${spirv}/bin\" NO_DEFAULT_PATH )" \ + --replace " spirv-mesa3d-" "" \ + --replace " spirv64-mesa3d-" "" \ + --replace "NOT \''${t} MATCHES" \ + "NOT \''${ARCH} STREQUAL \"clspv\" AND NOT \''${ARCH} STREQUAL \"clspv64\" AND NOT \''${t} MATCHES" + ''; + + checkTargets = [ ]; + }; + + lldb = callPackage ./llvm.nix rec { + stdenv = rocmClangStdenv; + buildTests = false; # ld.lld: error: unable to find library -lllvm_gtest_main + targetName = "lldb"; + targetDir = targetName; + extraNativeBuildInputs = [ python3Packages.sphinx-automodapi ]; + + extraBuildInputs = [ + xz + swig + lua5_3 + gtest + ]; + + extraCMakeFlags = [ + "-DLLVM_EXTERNAL_LIT=${lit}/bin/.lit-wrapped" + "-DLLDB_INCLUDE_TESTS=ON" + "-DLLDB_INCLUDE_UNITTESTS=ON" + ]; + }; + + mlir = callPackage ./llvm.nix rec { + stdenv = rocmClangStdenv; + buildDocs = false; # No decent way to hack this to work + buildMan = false; # No man pages to build + targetName = "mlir"; + targetDir = targetName; + extraNativeBuildInputs = [ hip ]; + + extraBuildInputs = [ + rocm-comgr + vulkan-headers + vulkan-loader + glslang + shaderc + ]; + + extraCMakeFlags = [ + "-DCMAKE_POLICY_DEFAULT_CMP0116=NEW" + "-DMLIR_INCLUDE_DOCS=ON" + "-DMLIR_INCLUDE_TESTS=ON" + "-DMLIR_ENABLE_ROCM_RUNNER=ON" + "-DMLIR_ENABLE_SPIRV_CPU_RUNNER=ON" + "-DMLIR_ENABLE_VULKAN_RUNNER=ON" + "-DROCM_TEST_CHIPSET=gfx000" # CPU runner + ]; + + extraPostPatch = '' + chmod +w ../llvm + mkdir -p ../llvm/build/bin + ln -s ${lit}/bin/lit ../llvm/build/bin/llvm-lit + + substituteInPlace test/CMakeLists.txt \ + --replace "FileCheck count not" "" \ + --replace "list(APPEND MLIR_TEST_DEPENDS mlir_rocm_runtime)" "" + + substituteInPlace lib/ExecutionEngine/CMakeLists.txt \ + --replace "return()" "" + + # Remove problematic tests + rm test/CAPI/execution_engine.c + rm test/Target/LLVMIR/llvmir-intrinsics.mlir + rm test/Target/LLVMIR/llvmir.mlir + rm test/Target/LLVMIR/openmp-llvm.mlir + rm test/mlir-cpu-runner/*.mlir + rm test/mlir-vulkan-runner/*.mlir + ''; + + extraPostInstall = '' + mkdir -p $out/bin + mv bin/mlir-tblgen $out/bin + ''; + + checkTargets = [ "check-${targetName}" ]; + }; + + polly = callPackage ./llvm.nix rec { + stdenv = rocmClangStdenv; + targetName = "polly"; + targetDir = targetName; + checkTargets = [ "check-${targetName}" ]; + }; + + flang = callPackage ./llvm.nix rec { + stdenv = rocmClangStdenv; + buildTests = false; # `Executable "flang1" doesn't exist!` + targetName = "flang"; + targetDir = targetName; + extraNativeBuildInputs = [ python3Packages.sphinx-markdown-tables ]; + extraBuildInputs = [ mlir ]; + + extraCMakeFlags = [ + "-DCMAKE_POLICY_DEFAULT_CMP0116=NEW" + "-DCLANG_DIR=${clang-unwrapped}/lib/cmake/clang" + "-DFLANG_INCLUDE_TESTS=OFF" + "-DMLIR_TABLEGEN_EXE=${mlir}/bin/mlir-tblgen" + ]; + + extraPostPatch = '' + substituteInPlace test/CMakeLists.txt \ + --replace "FileCheck" "" \ + --replace "count" "" \ + --replace "not" "" + + substituteInPlace docs/CMakeLists.txt \ + --replace "CLANG_TABLEGEN_EXE clang-tblgen" "CLANG_TABLEGEN_EXE ${clang-unwrapped}/bin/clang-tblgen" + ''; + }; + + openmp = callPackage ./llvm.nix rec { + stdenv = rocmClangStdenv; + buildTests = false; # Too many failures, most pass + targetName = "openmp"; + targetDir = targetName; + extraPatches = [ ./0000-fix-openmp.patch ]; + extraNativeBuildInputs = [ perl ]; + + extraBuildInputs = [ + rocm-device-libs + rocm-runtime + elfutils + ]; + + extraCMakeFlags = [ + "-DCMAKE_MODULE_PATH=/build/source/llvm/cmake/modules" # For docs + "-DCLANG_TOOL=${clang}/bin/clang" + "-DCLANG_OFFLOAD_BUNDLER_TOOL=${clang-unwrapped}/bin/clang-offload-bundler" + "-DOPENMP_LLVM_TOOLS_DIR=${llvm}/bin" + "-DOPENMP_LLVM_LIT_EXECUTABLE=${lit}/bin/.lit-wrapped" + "-DDEVICELIBS_ROOT=${rocm-device-libs.src}" + ]; + + extraPostPatch = '' + # We can't build this target at the moment + substituteInPlace libomptarget/DeviceRTL/CMakeLists.txt \ + --replace "gfx1010" "" + ''; + + checkTargets = [ "check-${targetName}" ]; + extraLicenses = [ lib.licenses.mit ]; + }; + + # Runtimes + pstl = callPackage ./llvm.nix rec { + stdenv = rocmClangStdenv; + buildDocs = false; # No documentation to build + buildMan = false; # No man pages to build + buildTests = false; # Too many errors + targetName = "pstl"; + targetDir = "runtimes"; + targetRuntimes = [ targetName ]; + checkTargets = [ "check-${targetName}" ]; }; } diff --git a/pkgs/development/compilers/llvm/rocm/llvm.nix b/pkgs/development/compilers/llvm/rocm/llvm.nix index b148b936ca56..731c0557bf2e 100644 --- a/pkgs/development/compilers/llvm/rocm/llvm.nix +++ b/pkgs/development/compilers/llvm/rocm/llvm.nix @@ -1,22 +1,44 @@ -{ stdenv -, lib -, fetchgit +{ lib +, stdenv , fetchFromGitHub -, writeScript +, rocmUpdateScript +, pkg-config , cmake , ninja -, python3 +, git +, doxygen +, sphinx +, lit , libxml2 -, libffi -, libbfd , libxcrypt -, ncurses +, libedit +, libffi +, mpfr , zlib -, debugVersion ? false -, enableManpages ? false - -, version -, src +, ncurses +, python3Packages +, buildDocs ? true +, buildMan ? true +, buildTests ? true +, targetName ? "llvm" +, targetDir ? "llvm" +, targetProjects ? [ ] +, targetRuntimes ? [ ] +, extraPatches ? [ ] +, extraNativeBuildInputs ? [ ] +, extraBuildInputs ? [ ] +, extraCMakeFlags ? [ ] +, extraPostPatch ? "" +, checkTargets ? [( + lib.optionalString buildTests ( + if targetDir == "runtimes" + then "check-runtimes" + else "check-all" + ) +)] +, extraPostInstall ? "" +, extraLicenses ? [ ] +, isBroken ? false }: let @@ -25,73 +47,119 @@ let else if stdenv.isAarch64 then "AArch64" else throw "Unsupported ROCm LLVM platform"; in stdenv.mkDerivation (finalAttrs: { - inherit src version; + pname = "rocm-llvm-${targetName}"; + version = "5.4.1"; - pname = "rocm-llvm"; - - sourceRoot = "${src.name}/llvm"; - - nativeBuildInputs = [ cmake ninja python3 ]; - - buildInputs = [ libxml2 libxcrypt ]; - - propagatedBuildInputs = [ ncurses zlib ]; - - cmakeFlags = with stdenv; [ - "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" - "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc - "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" - "-DLLVM_ENABLE_PROJECTS=clang;lld;compiler-rt" - ] - ++ lib.optionals enableManpages [ - "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" - "-DLLVM_BUILD_DOCS=ON" - "-DLLVM_ENABLE_SPHINX=ON" - "-DSPHINX_OUTPUT_MAN=ON" - "-DSPHINX_OUTPUT_HTML=OFF" - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + outputs = [ + "out" + ] ++ lib.optionals buildDocs [ + "doc" + ] ++ lib.optionals buildMan [ + "man" + "info" # Avoid `attribute 'info' missing` when using with wrapCC ]; - postPatch = '' + patches = extraPatches; + + src = fetchFromGitHub { + owner = "RadeonOpenCompute"; + repo = "llvm-project"; + rev = "rocm-${finalAttrs.version}"; + hash = "sha256-rlVo77h344PLGj/mIzsw+/ndWywsBsiKDXsEDpWSUno="; + }; + + nativeBuildInputs = [ + pkg-config + cmake + ninja + git + python3Packages.python + ] ++ lib.optionals (buildDocs || buildMan) [ + doxygen + sphinx + python3Packages.recommonmark + ] ++ lib.optionals (buildTests && !finalAttrs.passthru.isLLVM) [ + lit + ] ++ extraNativeBuildInputs; + + buildInputs = [ + libxml2 + libxcrypt + libedit + libffi + mpfr + ] ++ extraBuildInputs; + + propagatedBuildInputs = lib.optionals finalAttrs.passthru.isLLVM [ + zlib + ncurses + ]; + + sourceRoot = "${finalAttrs.src.name}/${targetDir}"; + + cmakeFlags = [ + "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" + ] ++ lib.optionals (finalAttrs.passthru.isLLVM && targetProjects != [ ]) [ + "-DLLVM_ENABLE_PROJECTS=${lib.concatStringsSep ";" targetProjects}" + ] ++ lib.optionals ((finalAttrs.passthru.isLLVM || targetDir == "runtimes") && targetRuntimes != [ ]) [ + "-DLLVM_ENABLE_RUNTIMES=${lib.concatStringsSep ";" targetRuntimes}" + ] ++ lib.optionals (finalAttrs.passthru.isLLVM || finalAttrs.passthru.isClang) [ + "-DLLVM_ENABLE_RTTI=ON" + "-DLLVM_ENABLE_EH=ON" + ] ++ lib.optionals (buildDocs || buildMan) [ + "-DLLVM_INCLUDE_DOCS=ON" + "-DLLVM_BUILD_DOCS=ON" + # "-DLLVM_ENABLE_DOXYGEN=ON" Way too slow, only uses one core + "-DLLVM_ENABLE_SPHINX=ON" + "-DLLVM_ENABLE_OCAMLDOC=OFF" + "-DSPHINX_OUTPUT_HTML=ON" + "-DSPHINX_OUTPUT_MAN=ON" + "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ lib.optionals buildTests [ + "-DLLVM_INCLUDE_TESTS=ON" + "-DLLVM_BUILD_TESTS=ON" + ] ++ lib.optionals (buildTests && !finalAttrs.passthru.isLLVM) [ + "-DLLVM_EXTERNAL_LIT=${lit}/bin/.lit-wrapped" + ] ++ extraCMakeFlags; + + postPatch = lib.optionalString finalAttrs.passthru.isLLVM '' patchShebangs lib/OffloadArch/make_generated_offload_arch_h.sh - substituteInPlace ../clang/cmake/modules/CMakeLists.txt \ - --replace 'FILES_MATCHING' 'NO_SOURCE_PERMISSIONS FILES_MATCHING' - ''; + '' + lib.optionalString (buildTests && finalAttrs.passthru.isLLVM) '' + # FileSystem permissions tests fail with various special bits + rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test + rm unittests/Support/Path.cpp + + substituteInPlace unittests/Support/CMakeLists.txt \ + --replace "Path.cpp" "" + '' + extraPostPatch; + + doCheck = buildTests; + checkTarget = lib.concatStringsSep " " checkTargets; + + postInstall = lib.optionalString finalAttrs.passthru.isLLVM '' + # `lit` expects these for some test suites + mv bin/{FileCheck,not,count,yaml2obj,obj2yaml} $out/bin + '' + lib.optionalString buildMan '' + mkdir -p $info + '' + extraPostInstall; passthru = { - isClang = true; + isLLVM = targetDir == "llvm"; + isClang = targetDir == "clang" || builtins.elem "clang" targetProjects; - updateScript = writeScript "update.sh" '' - #!/usr/bin/env nix-shell - #!nix-shell -i bash -p curl jq common-updater-scripts nix-prefetch-github - - version="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ - -sL "https://api.github.com/repos/RadeonOpenCompute/llvm-project/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)" - - IFS='.' read -a version_arr <<< "$version" - - if [ "''${#version_arr[*]}" == 2 ]; then - version="''${version}.0" - fi - - current_version="$(grep "version =" pkgs/development/compilers/llvm/rocm/default.nix | cut -d'"' -f2)" - if [[ "$version" != "$current_version" ]]; then - tarball_meta="$(nix-prefetch-github RadeonOpenCompute llvm-project --rev "rocm-$version")" - tarball_hash="$(nix to-base64 sha256-$(jq -r '.sha256' <<< "$tarball_meta"))" - sed -i "pkgs/development/compilers/llvm/rocm/default.nix" \ - -e 's,version = "\(.*\)",version = "'"$version"'",' \ - -e 's,hash = "\(.*\)",hash = "sha256-'"$tarball_hash"'",' - else - echo rocm-llvm already up-to-date - fi - ''; + updateScript = rocmUpdateScript { + name = finalAttrs.pname; + owner = finalAttrs.src.owner; + repo = finalAttrs.src.repo; }; + }; meta = with lib; { description = "ROCm fork of the LLVM compiler infrastructure"; homepage = "https://github.com/RadeonOpenCompute/llvm-project"; - license = with licenses; [ ncsa ]; + license = with licenses; [ ncsa ] ++ extraLicenses; maintainers = with maintainers; [ acowley lovesegfault ] ++ teams.rocm.members; platforms = platforms.linux; + broken = isBroken; }; }) diff --git a/pkgs/development/compilers/nasm/default.nix b/pkgs/development/compilers/nasm/default.nix index ce053e87130f..b9f0e856f65c 100644 --- a/pkgs/development/compilers/nasm/default.nix +++ b/pkgs/development/compilers/nasm/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "nasm"; - version = "2.15.05"; + version = "2.16.01"; src = fetchurl { url = "https://www.nasm.us/pub/nasm/releasebuilds/${version}/${pname}-${version}.tar.xz"; - sha256 = "0gqand86b0r86k3h46dh560lykxmxqqywz5m55kgjfq7q4lngbrw"; + sha256 = "sha256-x3dF9IAjde/u4uxcCta38DfqnIfJKxSaljf/CZ8WJVg="; }; nativeBuildInputs = [ perl ]; diff --git a/pkgs/development/compilers/ocaml/builder.sh b/pkgs/development/compilers/ocaml/builder.sh index a1807682d867..88acc0654cf2 100644 --- a/pkgs/development/compilers/ocaml/builder.sh +++ b/pkgs/development/compilers/ocaml/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup configureFlags="-prefix $out $configureFlags" diff --git a/pkgs/development/compilers/openjdk/11.nix b/pkgs/development/compilers/openjdk/11.nix index 820469ab8f15..72b25bff777b 100644 --- a/pkgs/development/compilers/openjdk/11.nix +++ b/pkgs/development/compilers/openjdk/11.nix @@ -11,8 +11,8 @@ let major = "11"; minor = "0"; - update = "15"; - build = "10"; + update = "17"; + build = "8"; openjdk = stdenv.mkDerivation rec { pname = "openjdk" + lib.optionalString headless "-headless"; @@ -22,7 +22,7 @@ let owner = "openjdk"; repo = "jdk${major}u"; rev = "jdk-${version}"; - sha256 = "le2JDxPJPSuga4JxLJNRZwCaodptSb2kh4TsJXumTXs="; + sha256 = "sha256-kvgLYqQZPqyuigVyzbDHc3TMff0clvzM8IdzYLYcxPU="; }; nativeBuildInputs = [ pkg-config autoconf unzip ]; @@ -131,12 +131,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/12.nix b/pkgs/development/compilers/openjdk/12.nix index a8de9fe43ffc..bd3defbd6b98 100644 --- a/pkgs/development/compilers/openjdk/12.nix +++ b/pkgs/development/compilers/openjdk/12.nix @@ -135,12 +135,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/13.nix b/pkgs/development/compilers/openjdk/13.nix index 5b7e87b0ef3a..40dc753f7955 100644 --- a/pkgs/development/compilers/openjdk/13.nix +++ b/pkgs/development/compilers/openjdk/13.nix @@ -135,12 +135,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/14.nix b/pkgs/development/compilers/openjdk/14.nix index 1381b0995a76..047e1a390819 100644 --- a/pkgs/development/compilers/openjdk/14.nix +++ b/pkgs/development/compilers/openjdk/14.nix @@ -131,12 +131,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/15.nix b/pkgs/development/compilers/openjdk/15.nix index 6ea1d0b1dd31..c33e937f9f24 100644 --- a/pkgs/development/compilers/openjdk/15.nix +++ b/pkgs/development/compilers/openjdk/15.nix @@ -131,12 +131,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/16.nix b/pkgs/development/compilers/openjdk/16.nix index 0e1911bb1a70..461cd724144e 100644 --- a/pkgs/development/compilers/openjdk/16.nix +++ b/pkgs/development/compilers/openjdk/16.nix @@ -138,12 +138,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/17.nix b/pkgs/development/compilers/openjdk/17.nix index bc92b1393fdb..6d8087d7e948 100644 --- a/pkgs/development/compilers/openjdk/17.nix +++ b/pkgs/development/compilers/openjdk/17.nix @@ -149,12 +149,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort -u | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/18.nix b/pkgs/development/compilers/openjdk/18.nix index 600899677fed..37b51a1ee4ce 100644 --- a/pkgs/development/compilers/openjdk/18.nix +++ b/pkgs/development/compilers/openjdk/18.nix @@ -147,12 +147,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort -u | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/19.nix b/pkgs/development/compilers/openjdk/19.nix index fb4a273aed4f..717bfedcb635 100644 --- a/pkgs/development/compilers/openjdk/19.nix +++ b/pkgs/development/compilers/openjdk/19.nix @@ -149,12 +149,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort -u | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/8.nix b/pkgs/development/compilers/openjdk/8.nix index c232b1f01f16..c65a9fcc66b6 100644 --- a/pkgs/development/compilers/openjdk/8.nix +++ b/pkgs/development/compilers/openjdk/8.nix @@ -20,7 +20,7 @@ let powerpc64le-linux = "ppc64le"; }.${stdenv.system} or (throw "Unsupported platform ${stdenv.system}"); - update = "322"; + update = "352"; build = "ga"; openjdk8 = stdenv.mkDerivation rec { @@ -31,7 +31,7 @@ let owner = "openjdk"; repo = "jdk8u"; rev = "jdk${version}"; - sha256 = "sha256-e39Yv+NDQG7z6fGmpKEnkKd5MoHZ50SXlq/Q7lzWcDA="; + sha256 = "sha256-xDiiALDjStD9IPhbBr997rm/v2Q/WdS10cILBCmdJIQ="; }; outputs = [ "out" "jre" ]; @@ -187,12 +187,12 @@ let postFixup = '' # Build the set of output library directories to rpath against LIBDIRS="" - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" done # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do + for output in $(getAllOutputNames); do if [ "$output" = debug ]; then continue; fi OUTPUTDIR=$(eval echo \$$output) BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) diff --git a/pkgs/development/compilers/openjdk/openjfx/11.nix b/pkgs/development/compilers/openjdk/openjfx/11.nix index 1bbb4e42dbc5..164677c3b8dc 100644 --- a/pkgs/development/compilers/openjdk/openjfx/11.nix +++ b/pkgs/development/compilers/openjdk/openjfx/11.nix @@ -1,13 +1,13 @@ -{ stdenv, lib, fetchurl, writeText, gradle_4, pkg-config, perl, cmake -, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsa-lib, ffmpeg_4-headless, python3, ruby +{ stdenv, lib, fetchFromGitHub, writeText, gradle_7, pkg-config, perl, cmake +, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsa-lib, ffmpeg_4-headless, python3, ruby, icu68 , openjdk11-bootstrap }: let major = "11"; - update = ".0.11"; + update = ".0.17"; build = "1"; repover = "${major}${update}+${build}"; - gradle_ = (gradle_4.override { + gradle_ = (gradle_7.override { java = openjdk11-bootstrap; }); @@ -24,12 +24,14 @@ let makePackage = args: stdenv.mkDerivation ({ version = "${major}${update}-${build}"; - src = fetchurl { - url = "https://hg.openjdk.java.net/openjfx/${major}-dev/rt/archive/${repover}.tar.gz"; - sha256 = "sha256-mbEALUxuwbtlGeZ2Xsm3m3aNDdthLYWd6QHmdkAILxc="; + src = fetchFromGitHub { + owner = "openjdk"; + repo = "jfx${major}u"; + rev = repover; + sha256 = "sha256-uKb6k+tIFdwy1BYiHWeGmKNz82X4CZjFlGYqLDpSFY0="; }; - buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsa-lib ffmpeg_4-headless ]; + buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsa-lib ffmpeg_4-headless icu68 ]; nativeBuildInputs = [ gradle_ perl pkg-config cmake gperf python3 ruby ]; dontUseCmakeConfigure = true; @@ -44,8 +46,6 @@ let JDK_HOME = ${openjdk11-bootstrap.home} '' + args.gradleProperties or ""); - inherit NIX_CFLAGS_COMPILE; - buildPhase = '' runHook preBuild @@ -74,10 +74,7 @@ let outputHashAlgo = "sha256"; outputHashMode = "recursive"; - # Downloaded AWT jars differ by platform. - outputHash = { - x86_64-linux = "sha256-syceJMUEknBDCHK8eGs6rUU3IQn+HnQfURfCrDxYPa8="; - }.${stdenv.system} or (throw "Unsupported platform"); + outputHash = "sha256-syceJMUEknBDCHK8eGs6rUU3IQn+HnQfURfCrDxYPa9="; }; in makePackage { @@ -85,7 +82,7 @@ in makePackage { gradleProperties = '' COMPILE_MEDIA = true - COMPILE_WEBKIT = true + COMPILE_WEBKIT = false ''; preBuild = '' @@ -99,8 +96,6 @@ in makePackage { cp -r build/modular-sdk $out ''; - inherit NIX_CFLAGS_COMPILE; - stripDebugList = [ "." ]; postFixup = '' diff --git a/pkgs/development/compilers/openjdk/openjfx/15.nix b/pkgs/development/compilers/openjdk/openjfx/15.nix index d2903c685a90..788baabde848 100644 --- a/pkgs/development/compilers/openjdk/openjfx/15.nix +++ b/pkgs/development/compilers/openjdk/openjfx/15.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, writeText, openjdk11_headless, gradle_5 +{ stdenv, lib, fetchFromGitHub, writeText, openjdk11_headless, gradle_6 , pkg-config, perl, cmake, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsa-lib , ffmpeg_4-headless, python3, ruby }: @@ -7,7 +7,7 @@ let update = ".0.1"; build = "+1"; repover = "${major}${update}${build}"; - gradle_ = (gradle_5.override { + gradle_ = (gradle_6.override { java = openjdk11_headless; }); @@ -69,10 +69,7 @@ let outputHashAlgo = "sha256"; outputHashMode = "recursive"; - # Downloaded AWT jars differ by platform. - outputHash = { - x86_64-linux = "0hmyr5nnjgwyw3fcwqf0crqg9lny27jfirycg3xmkzbcrwqd6qkw"; - }.${stdenv.system} or (throw "Unsupported platform"); + outputHash = "sha256-fGLTMM9s/Vn7eMzn6OQR3tL0cGbAYc7c4J4/aW3JvkI="; }; in makePackage { @@ -80,7 +77,7 @@ in makePackage { gradleProperties = '' COMPILE_MEDIA = true - COMPILE_WEBKIT = true + COMPILE_WEBKIT = false ''; preBuild = '' @@ -120,6 +117,9 @@ in makePackage { license = licenses.gpl2; description = "The next-generation Java client toolkit"; maintainers = with maintainers; [ abbradar ]; + knownVulnerabilities = [ + "This OpenJFX version has reached its end of life." + ]; platforms = [ "x86_64-linux" ]; }; } diff --git a/pkgs/development/compilers/openjdk/openjfx/17.nix b/pkgs/development/compilers/openjdk/openjfx/17.nix index 1c1fb89ce8e1..8d4d47df32e7 100644 --- a/pkgs/development/compilers/openjdk/openjfx/17.nix +++ b/pkgs/development/compilers/openjdk/openjfx/17.nix @@ -4,7 +4,7 @@ let major = "17"; - update = ".0.0.1"; + update = ".0.5"; build = "+1"; repover = "${major}${update}${build}"; gradle_ = (gradle_7.override { @@ -16,9 +16,9 @@ let src = fetchFromGitHub { owner = "openjdk"; - repo = "jfx"; + repo = "jfx${major}u"; rev = repover; - sha256 = "sha256-PSiE9KbF/4u9VyBl9PAMLGzKyGFB86/XByeh7vhL6Kw="; + sha256 = "sha256-jzLOlWuhkUS0/4+nXtjd1/IYbAHHnJrusFRTh7aPt8U="; }; buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsa-lib ffmpeg_4-headless icu68 ]; diff --git a/pkgs/development/compilers/orc/default.nix b/pkgs/development/compilers/orc/default.nix index 5ea72781e41f..771830d8b6ac 100644 --- a/pkgs/development/compilers/orc/default.nix +++ b/pkgs/development/compilers/orc/default.nix @@ -1,15 +1,28 @@ -{ lib, stdenv, fetchurl, meson, ninja -, gtk-doc ? null, file, docbook_xsl +{ lib +, stdenv +, fetchurl +, meson +, ninja +, file +, docbook_xsl +, gtk-doc ? null , buildDevDoc ? gtk-doc != null + +# for passthru.tests +, gnuradio +, gst_all_1 +, qt6 +, vips + }: let inherit (lib) optional optionals; in stdenv.mkDerivation rec { pname = "orc"; - version = "0.4.32"; + version = "0.4.33"; src = fetchurl { url = "https://gstreamer.freedesktop.org/src/orc/${pname}-${version}.tar.xz"; - sha256 = "1w0qmyj3v9sb2g7ff39pp38b9850y9hyy0bag26ifrby5f7ksvm6"; + sha256 = "sha256-hE5tfbgIb3k/V2GNPUto0p2ZsWA05xQw3zwhz9PDVCo="; }; postPatch = lib.optionalString stdenv.isAarch32 '' @@ -35,6 +48,12 @@ in stdenv.mkDerivation rec { doCheck = true; + passthru.tests = { + inherit (gst_all_1) gst-plugins-good gst-plugins-bad gst-plugins-ugly; + inherit gnuradio vips; + qt6-qtmultimedia = qt6.qtmultimedia; + }; + meta = with lib; { description = "The Oil Runtime Compiler"; homepage = "https://gstreamer.freedesktop.org/projects/orc.html"; diff --git a/pkgs/development/compilers/rust/1_65.nix b/pkgs/development/compilers/rust/1_66.nix similarity index 56% rename from pkgs/development/compilers/rust/1_65.nix rename to pkgs/development/compilers/rust/1_66.nix index 5b2397b5de48..ada9054973fa 100644 --- a/pkgs/development/compilers/rust/1_65.nix +++ b/pkgs/development/compilers/rust/1_66.nix @@ -20,8 +20,8 @@ } @ args: import ./default.nix { - rustcVersion = "1.65.0"; - rustcSha256 = "sha256-WCi7Z/Z36r+MOEAgWCsM56+IThyEOJSE9/jQDdgsADg="; + rustcVersion = "1.66.0"; + rustcSha256 = "sha256-OzzT6lqCombnXQs18LVMFgIVdtnreNOEBSF1p3KTWkg="; llvmSharedForBuild = pkgsBuildBuild.llvmPackages_14.libllvm.override { enableSharedLibraries = true; }; llvmSharedForHost = pkgsBuildHost.llvmPackages_14.libllvm.override { enableSharedLibraries = true; }; @@ -37,25 +37,25 @@ import ./default.nix { # Note: the version MUST be one version prior to the version we're # building - bootstrapVersion = "1.64.0"; + bootstrapVersion = "1.65.0"; # fetch hashes by running `print-hashes.sh ${bootstrapVersion}` bootstrapHashes = { - i686-unknown-linux-gnu = "177b4f95c8cdaa34bb29e69950cbfe236e123757078af4792779c43ee3818199"; - x86_64-unknown-linux-gnu = "a893977f238291370ab96726a74b6b9ae854dc75fbf5730954d901a93843bf9b"; - x86_64-unknown-linux-musl = "d5c4293a8fe1b34d857bec4124229c39711f8759aa2f6108c8b6c22a308f96bb"; - arm-unknown-linux-gnueabihf = "0d7c9c746f7b98f1f99e4cf720f9a32b2f5cdf22cb1d9f677b41c1dca62f14f8"; - armv7-unknown-linux-gnueabihf = "0be29740f565ca8835ba260691274585733a7f4130ec872bfa37654a08013828"; - aarch64-unknown-linux-gnu = "7d8860572431bd4ee1b9cd0cd77cf7ff29fdd5b91ed7c92a820f872de6ced558"; - aarch64-unknown-linux-musl = "9e7cfd960fb8ad3e1f51ef667c56032d3d4d9d9f573a06bbcf65a7c7a96ab430"; - x86_64-apple-darwin = "b6003d49fb857ff8dc105a3ccba98b851cd3e7d874005acb92284fd1113adc0d"; - aarch64-apple-darwin = "e1a37dc5991304716e260144311fd291d8fb514042e45c244c582b3454477038"; - powerpc64le-unknown-linux-gnu = "9d4591033eac22093d107991a68fffccea087b26bb54115d46cc544fbf5ef66c"; - riscv64gc-unknown-linux-gnu = "f63981d9c1057cb20cf30871757d42475a1cd0c187b3dcce5fabb0cce0f80c5b"; - mips64el-unknown-linux-gnuabi64 = "47488e4c53cca5c99b5837474a880f6c2368a7fe8368560dd8077bddb94959b5"; + i686-unknown-linux-gnu = "b29869f8e2c7029150a929b2c4e26843f363846ad99253a25be6abcfa8e84f46"; + x86_64-unknown-linux-gnu = "8f754fdd5af783fe9020978c64e414cb45f3ad0a6f44d045219bbf2210ca3cb9"; + x86_64-unknown-linux-musl = "716984def5509a844c2dde1c7be42bfadeb179f751d5c1a30c9c7198c8c089cd"; + arm-unknown-linux-gnueabihf = "e27f835c16bfcb66ad022a17d5c4602899e021e483a432ca4cc2cb4ecd39e938"; + armv7-unknown-linux-gnueabihf = "5376d467a29b32cacb771e0c76dc280bd623852709e7ffd92caabab076d5475f"; + aarch64-unknown-linux-gnu = "f406136010e6a1cdce3fb6573506f00d23858af49dd20a46723c3fa5257b7796"; + aarch64-unknown-linux-musl = "4b701dc3cbac04ebf0e336cff2f4ce5fc1a1984c183226863c9ed911eb00b07e"; + x86_64-apple-darwin = "139087a3937799415fd829e5a88162a69a32c23725a44457f9c96b98e4d64a7c"; + aarch64-apple-darwin = "7ddc335bd10fc32d3039ef36248a5d0c4865db2437c8aad20a2428a6cf41df09"; + powerpc64le-unknown-linux-gnu = "3f1d0d5bb13213348dc65e373f8c412fc0a12ee55abc1c864f7e0300932fc687"; + riscv64gc-unknown-linux-gnu = "aac7067348d218faa452b4bdc735778a51570a310ad645313ec767b5d7c88492"; + mips64el-unknown-linux-gnuabi64 = "d91ed3857c5256720da890f6533684b684e880bf9006dc4e4f4181213a5c4a09"; }; - selectRustPackage = pkgs: pkgs.rust_1_65; + selectRustPackage = pkgs: pkgs.rust_1_66; rustcPatches = [ ]; diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index 2c9a3b1af472..291a64f2210c 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -1,7 +1,8 @@ { lib, stdenv, pkgsHostHost , file, curl, pkg-config, python3, openssl, cmake, zlib , installShellFiles, makeWrapper, cacert, rustPlatform, rustc -, libiconv, CoreFoundation, Security +, CoreFoundation, Security +, auditable ? false # TODO: change to true when this is the default }: rustPlatform.buildRustPackage { @@ -12,6 +13,8 @@ rustPlatform.buildRustPackage { cargoVendorDir = "vendor"; buildAndTestSubdir = "src/tools/cargo"; + inherit auditable; + passthru = { rustc = rustc; inherit (rustc) tests; @@ -25,7 +28,7 @@ rustPlatform.buildRustPackage { (lib.getDev pkgsHostHost.curl) ]; buildInputs = [ cacert file curl python3 openssl zlib ] - ++ lib.optionals stdenv.isDarwin [ libiconv CoreFoundation Security ]; + ++ lib.optionals stdenv.isDarwin [ CoreFoundation Security ]; # cargo uses git-rs which is made for a version of libgit2 from recent master that # is not compatible with the current version in nixpkgs. diff --git a/pkgs/development/compilers/rust/make-rust-platform.nix b/pkgs/development/compilers/rust/make-rust-platform.nix index 7e98684ecff1..fcfd02dcf6cd 100644 --- a/pkgs/development/compilers/rust/make-rust-platform.nix +++ b/pkgs/development/compilers/rust/make-rust-platform.nix @@ -13,7 +13,6 @@ rec { }; buildRustPackage = callPackage ../../../build-support/rust/build-rust-package { - git = buildPackages.gitMinimal; inherit stdenv cargoBuildHook cargoCheckHook cargoInstallHook cargoNextestHook cargoSetupHook fetchCargoTarball importCargoLock rustc; }; diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 8288cd5c61e3..43d603923c97 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -163,11 +163,10 @@ in stdenv.mkDerivation rec { ]; buildInputs = [ openssl ] - ++ optionals stdenv.isDarwin [ Security ] + # TODO: remove libiconv once 1.66 is used to bootstrap + ++ optionals stdenv.isDarwin [ libiconv Security ] ++ optional (!withBundledLLVM) llvmShared; - depsTargetTargetPropagated = optionals stdenv.isDarwin [ libiconv ]; - outputs = [ "out" "man" "doc" ]; setOutputFlags = false; diff --git a/pkgs/development/compilers/spirv-llvm-translator/default.nix b/pkgs/development/compilers/spirv-llvm-translator/default.nix index 971b3e8399df..052df63aecb0 100644 --- a/pkgs/development/compilers/spirv-llvm-translator/default.nix +++ b/pkgs/development/compilers/spirv-llvm-translator/default.nix @@ -10,12 +10,14 @@ let llvmMajor = lib.versions.major llvm.version; + isROCm = lib.hasPrefix "rocm" llvm.pname; + # ROCm will always be at the latest version branch = - if llvmMajor == "15" then rec { + if llvmMajor == "15" || isROCm then rec { version = "15.0.0"; rev = "v${version}"; - hash = "sha256-111yL6Wh8hykoGz1QmT1F7lfGDEmG4U3iqmqrJxizOg="; + hash = "sha256-OsDohXRxovtEXaWiRGp8gJ0dXmoALyO+ZimeSO8aPVI="; } else if llvmMajor == "14" then rec{ version = "14.0.0"; rev = "v${version}"; @@ -36,15 +38,17 @@ stdenv.mkDerivation { inherit (branch) rev hash; }; - nativeBuildInputs = [ pkg-config cmake llvm.dev spirv-tools ]; + nativeBuildInputs = [ pkg-config cmake spirv-tools ] + ++ (if isROCm then [ llvm ] else [ llvm.dev ]); - buildInputs = [ spirv-headers llvm ]; + buildInputs = [ spirv-headers ] + ++ lib.optionals (!isROCm) [ llvm ]; checkInputs = [ lit ]; cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=ON" - "-DLLVM_DIR=${llvm.dev}" + "-DLLVM_DIR=${(if isROCm then llvm else llvm.dev)}" "-DBUILD_SHARED_LIBS=YES" "-DLLVM_SPIRV_BUILD_EXTERNAL=YES" # RPATH of binary /nix/store/.../bin/llvm-spirv contains a forbidden reference to /build/ diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 8d55ea6c39cb..388802fca8c6 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -293,15 +293,17 @@ in with passthru; stdenv.mkDerivation { substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" ''; - CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs); - LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs); - LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"}"; - NIX_LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) ({ - "glibc" = "-lgcc_s"; - "musl" = "-lgcc_eh"; - }."${stdenv.hostPlatform.libc}" or ""); - # Determinism: We fix the hashes of str, bytes and datetime objects. - PYTHONHASHSEED=0; + env = { + CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs); + LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs); + LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"}"; + NIX_LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) ({ + "glibc" = "-lgcc_s"; + "musl" = "-lgcc_eh"; + }."${stdenv.hostPlatform.libc}" or ""); + # Determinism: We fix the hashes of str, bytes and datetime objects. + PYTHONHASHSEED=0; + }; configureFlags = [ "--without-ensurepip" diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index d30876aa9fde..08dc3ea61ab7 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -93,7 +93,7 @@ in { makePythonHook { name = "python-imports-check-hook.sh"; substitutions = { - inherit pythonCheckInterpreter; + inherit pythonCheckInterpreter pythonSitePackages; }; } ./python-imports-check-hook.sh) {}; diff --git a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh index f8ca84cd573a..7172ac498545 100644 --- a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh @@ -6,6 +6,7 @@ pythonImportsCheckPhase () { if [ -n "$pythonImportsCheck" ]; then echo "Check whether the following modules can be imported: $pythonImportsCheck" + export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH" ( cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'" ) fi } diff --git a/pkgs/development/interpreters/python/hooks/sphinx-hook.sh b/pkgs/development/interpreters/python/hooks/sphinx-hook.sh index ae386ca859f4..ca67fa9beabf 100644 --- a/pkgs/development/interpreters/python/hooks/sphinx-hook.sh +++ b/pkgs/development/interpreters/python/hooks/sphinx-hook.sh @@ -57,7 +57,7 @@ installSphinxPhase() { else # shellcheck disable=2154 - docdir="${doc:-$out}/share/doc/${pname}" + docdir="${doc:-$out}/share/doc/${name}" mkdir -p "$docdir" diff --git a/pkgs/development/interpreters/python/setup-hook.nix b/pkgs/development/interpreters/python/setup-hook.nix index 29ce079317f0..8cfb9dd46784 100644 --- a/pkgs/development/interpreters/python/setup-hook.nix +++ b/pkgs/development/interpreters/python/setup-hook.nix @@ -6,7 +6,9 @@ let hook = ./setup-hook.sh; in runCommand "python-setup-hook.sh" { strictDeps = true; - inherit sitePackages; + env = { + inherit sitePackages; + }; } '' cp ${hook} hook.sh substituteAllInPlace hook.sh diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 04ed31bbf3aa..57d1e6d84fe1 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -187,6 +187,18 @@ let sed -i '/CC_VERSION_MESSAGE/d' $rbConfig '' } + + # Allow to override compiler. This is important for cross compiling as + # we need to set a compiler that is different from the build one. + awk -i inplace -F' = ' \ + ' # operate on the line starting with + /^ CONFIG\["CC"\]/ { + # replace the right hand side + sub($2, "ENV[\"CC\"] || \"1\"") + }; { print }' "$rbConfig" + # test that the line isn't mangled in case upstream made the above unnecessary + grep -qx ' CONFIG\["CC"\] = ENV\["CC"\] || "1"' "$rbConfig" + # Remove unnecessary external intermediate files created by gems extMakefiles=$(find $out/${passthru.gemPath} -name Makefile) for makefile in $extMakefiles; do diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index 34e26f547093..de5aff6c3b6e 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , fetchurl -, autoreconfHook # doc: https://github.com/ivmai/bdwgc/blob/v8.2.2/doc/README.macros (LARGE_CONFIG) , enableLargeConfig ? false , enableMmap ? true @@ -36,14 +35,14 @@ stdenv.mkDerivation (finalAttrs: { # don't forget to disable the fix (and if the next release does # not fix the problem the test failure will be a reminder to # extend the set of versions requiring the workaround). - makeFlags = if (stdenv.hostPlatform.isPower64 && + makeFlags = lib.optionals (stdenv.hostPlatform.isPower64 && finalAttrs.version == "8.2.2") - then [ + [ # do not use /proc primitives to track dirty bits; see: # https://github.com/ivmai/bdwgc/issues/479#issuecomment-1279687537 # https://github.com/ivmai/bdwgc/blob/54522af853de28f45195044dadfd795c4e5942aa/include/private/gcconfig.h#L741 "CFLAGS_EXTRA=-DNO_SOFT_VDB" - ] else null; + ]; # `gctest` fails under emulation on aarch64-darwin doCheck = !(stdenv.isDarwin && stdenv.isx86_64); diff --git a/pkgs/development/libraries/clang-ocl/default.nix b/pkgs/development/libraries/clang-ocl/default.nix index 3341bc680fb0..1e844157e419 100644 --- a/pkgs/development/libraries/clang-ocl/default.nix +++ b/pkgs/development/libraries/clang-ocl/default.nix @@ -5,12 +5,11 @@ , cmake , rocm-cmake , rocm-device-libs -, clang }: stdenv.mkDerivation (finalAttrs: { pname = "clang-ocl"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; @@ -22,17 +21,9 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake rocm-cmake - clang ]; - buildInputs = [ - rocm-device-libs - ]; - - cmakeFlags = [ - "-DCMAKE_C_COMPILER=clang" - "-DCMAKE_CXX_COMPILER=clang++" - ]; + buildInputs = [ rocm-device-libs ]; passthru.updateScript = rocmUpdateScript { name = finalAttrs.pname; @@ -45,6 +36,6 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/RadeonOpenCompute/clang-ocl"; license = with licenses; [ mit ]; maintainers = teams.rocm.members; - broken = finalAttrs.version != clang.version; + broken = finalAttrs.version != stdenv.cc.cc.version; }; }) diff --git a/pkgs/development/libraries/composable_kernel/default.nix b/pkgs/development/libraries/composable_kernel/default.nix index f41a97b99ad7..2e74d8ba2765 100644 --- a/pkgs/development/libraries/composable_kernel/default.nix +++ b/pkgs/development/libraries/composable_kernel/default.nix @@ -6,6 +6,7 @@ , rocm-cmake , hip , openmp +, clang-tools-extra , gtest , buildTests ? false , buildExamples ? false @@ -14,7 +15,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "composable_kernel"; - version = "unstable-2022-12-08"; + version = "unstable-2022-12-15"; outputs = [ "out" @@ -29,20 +30,19 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "composable_kernel"; - rev = "d58b7f5155b44c8b608f3edc6a6eab314493ec1a"; - hash = "sha256-4nzyaWhPnY/0TygcoJAqVzdgfXOkf+o/BE2V9N+Bm7Q="; + rev = "0345963eef4f92e9c5eab608bb8557b5463a1dcb"; + hash = "sha256-IJbUZ3/UIPbYO9H+BUPP6T2HyUnC+FVbVPXQE5bEjRg="; }; nativeBuildInputs = [ cmake rocm-cmake hip + clang-tools-extra ]; buildInputs = [ openmp - ] ++ lib.optionals buildTests [ - gtest ]; cmakeFlags = [ @@ -50,16 +50,12 @@ stdenv.mkDerivation (finalAttrs: { "-DCMAKE_CXX_COMPILER=hipcc" ] ++ lib.optionals (gpuTargets != [ ]) [ "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + ] ++ lib.optionals buildTests [ + "-DGOOGLETEST_DIR=${gtest.src}" # Custom linker names ]; # No flags to build selectively it seems... - postPatch = '' - substituteInPlace test/CMakeLists.txt \ - --replace "include(googletest)" "" - - substituteInPlace CMakeLists.txt \ - --replace "enable_testing()" "" - '' + lib.optionalString (!buildTests) '' + postPatch = lib.optionalString (!buildTests) '' substituteInPlace CMakeLists.txt \ --replace "add_subdirectory(test)" "" '' + lib.optionalString (!buildExamples) '' @@ -67,15 +63,12 @@ stdenv.mkDerivation (finalAttrs: { --replace "add_subdirectory(example)" "" ''; - postInstall = '' - mkdir -p $out/bin - mv bin/ckProfiler $out/bin - '' + lib.optionalString buildTests '' + postInstall = lib.optionalString buildTests '' mkdir -p $test/bin - mv bin/test_* $test/bin + mv $out/bin/test_* $test/bin '' + lib.optionalString buildExamples '' mkdir -p $example/bin - mv bin/example_* $example/bin + mv $out/bin/example_* $example/bin ''; passthru.updateScript = unstableGitUpdater { }; @@ -85,9 +78,6 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/ROCmSoftwarePlatform/composable_kernel"; license = with licenses; [ mit ]; maintainers = teams.rocm.members; - # Several tests seem to either not compile or have a race condition - # Undefined reference to symbol '_ZTIN7testing4TestE' - # Try removing this next update - broken = buildTests; + broken = buildExamples; # bin/example_grouped_gemm_xdl_bfp16] Error 139 }; }) diff --git a/pkgs/development/libraries/ffmpeg/4.nix b/pkgs/development/libraries/ffmpeg/4.nix index e37e90d553a3..ac88df930768 100644 --- a/pkgs/development/libraries/ffmpeg/4.nix +++ b/pkgs/development/libraries/ffmpeg/4.nix @@ -1,15 +1,8 @@ -{ callPackage, fetchpatch, ... }@args: +{ callPackage, ... }@args: callPackage ./generic.nix (rec { - version = "4.4.2"; + version = "4.4.3"; branch = version; - sha256 = "sha256-+YpIJSDEdQdSGpB5FNqp77wThOBZG1r8PaGKqJfeKUg="; + sha256 = "sha256-M7jC281TD+HbVxBBU0Vgm0yiJ70NoeOpMy27DxH9Jzo="; - patches = [ - # SDL2 recently changed their versioning - (fetchpatch { - url = "https://git.videolan.org/?p=ffmpeg.git;a=patch;h=e5163b1d34381a3319214a902ef1df923dd2eeba"; - hash = "sha256-nLhP2+34cj5EgpnUrePZp60nYAxmbhZAEDfay4pBVk0="; - }) - ]; } // args) diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix index 9d94fe0c44ec..68907d798e19 100644 --- a/pkgs/development/libraries/freetype/default.nix +++ b/pkgs/development/libraries/freetype/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchurl , buildPackages, pkgsHostHost , pkg-config, which, makeWrapper -, zlib, bzip2, libpng, gnumake, glib +, zlib, bzip2, brotli, libpng, gnumake, glib , # FreeType supports LCD filtering (colloquially referred to as sub-pixel rendering). # LCD filtering is also known as ClearType and covered by several Microsoft patents. @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-R2byAVfMTPDNKS+Av5F/ktHEObJDrDAY3r9rkUDEGn8="; }; - propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype + propagatedBuildInputs = [ zlib bzip2 brotli libpng ]; # needed when linking against freetype # dependence on harfbuzz is looser than the reverse dependence nativeBuildInputs = [ pkg-config which makeWrapper ] diff --git a/pkgs/development/libraries/gd/default.nix b/pkgs/development/libraries/gd/default.nix index 7ea8ce6d29b4..c9845feb9678 100644 --- a/pkgs/development/libraries/gd/default.nix +++ b/pkgs/development/libraries/gd/default.nix @@ -1,4 +1,6 @@ -{ lib, stdenv, fetchurl +{ lib +, stdenv +, fetchurl , fetchpatch , autoconf , automake @@ -8,6 +10,7 @@ , libjpeg , libwebp , libtiff +, withXorg ? true , libXpm , libavif , fontconfig @@ -33,20 +36,22 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - configureFlags = - [ - "--enable-gd-formats" - ] + configureFlags = [ + "--enable-gd-formats" + ] # -pthread gets passed to clang, causing warnings ++ lib.optional stdenv.isDarwin "--enable-werror=no"; nativeBuildInputs = [ autoconf automake pkg-config ]; - buildInputs = [ zlib fontconfig freetype libpng libjpeg libwebp libtiff libXpm libavif ]; + buildInputs = [ zlib fontconfig freetype libpng libjpeg libwebp libtiff libavif ] + ++ lib.optional withXorg libXpm; outputs = [ "bin" "dev" "out" ]; - postFixup = ''moveToOutput "bin/gdlib-config" $dev''; + postFixup = '' + moveToOutput "bin/gdlib-config" $dev + ''; enableParallelBuilding = true; @@ -57,5 +62,6 @@ stdenv.mkDerivation rec { description = "A dynamic image creation library"; license = licenses.free; # some custom license platforms = platforms.unix; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index a1270af259cd..ae5b9f48293a 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -60,7 +60,9 @@ stdenv.mkDerivation rec { ../../../build-support/setup-hooks/role.bash ./gettext-setup-hook.sh ]; - gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl; + env = { + gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl; + }; enableParallelBuilding = true; enableParallelChecking = false; # fails sometimes diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 5b4b18cf9199..7cecc8e545d0 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -117,6 +117,20 @@ stdenv.mkDerivation (finalAttrs: { # Disable flaky test. # https://gitlab.gnome.org/GNOME/glib/-/issues/820 ./skip-timer-test.patch + + # GVariant security fixes + # https://discourse.gnome.org/t/multiple-fixes-for-gvariant-normalisation-issues-in-glib/12835 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3126.patch"; + sha256 = "CNCxouYy8xNHt4eJtPZ2eOi9b0SxzI2DkklNfQMk3d8="; + }) + + # Menu model security fix + # https://discourse.gnome.org/t/fixes-for-gdbusmenumodel-crashes-in-glib/12846 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/glib/-/commit/4f4d770a1e40f719d5a310cffdac29cbb4e20c11.patch"; + sha256 = "+S44AnC86HfbMwkRe1ll54IK9pLxaFD3LqiVhPelnXI="; + }) ]; outputs = [ "bin" "out" "dev" "devdoc" ]; diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 61c0c92d5280..c9bc557eec19 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -54,9 +54,6 @@ assert withGd -> gd != null && libpng != null; stdenv.mkDerivation ({ version = version + patchSuffix; - linuxHeaders = if withLinuxHeaders then linuxHeaders else null; - - inherit (stdenv) is64bit; enableParallelBuilding = true; @@ -72,9 +69,6 @@ stdenv.mkDerivation ({ */ ./2.35-master.patch.gz - /* Revert this patch contained in the previous bundle. For now, until we know more. */ - ./revert-mktime.patch - /* Allow NixOS and Nix to handle the locale-archive. */ ./nix-locale-archive.patch @@ -175,10 +169,14 @@ stdenv.mkDerivation ({ nativeBuildInputs = [ bison python3Minimal ] ++ extraNativeBuildInputs; buildInputs = [ linuxHeaders ] ++ lib.optionals withGd [ gd libpng ] ++ extraBuildInputs; - # Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to - # prevent a retained dependency on the bootstrap tools in the stdenv-linux - # bootstrap. - BASH_SHELL = "/bin/sh"; + env = { + linuxHeaders = if withLinuxHeaders then linuxHeaders else ""; + inherit (stdenv) is64bit; + # Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to + # prevent a retained dependency on the bootstrap tools in the stdenv-linux + # bootstrap. + BASH_SHELL = "/bin/sh"; + }; # Used by libgcc, elf-header, and others to determine ABI passthru = { inherit version; minorRelease = version; }; diff --git a/pkgs/development/libraries/glibc/locales-builder.sh b/pkgs/development/libraries/glibc/locales-builder.sh index d732e208fa22..d91f936c937b 100644 --- a/pkgs/development/libraries/glibc/locales-builder.sh +++ b/pkgs/development/libraries/glibc/locales-builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi # Glibc cannot have itself in its RPATH. export NIX_NO_SELF_RPATH=1 diff --git a/pkgs/development/libraries/glibc/revert-mktime.patch b/pkgs/development/libraries/glibc/revert-mktime.patch deleted file mode 100644 index d691213e8657..000000000000 --- a/pkgs/development/libraries/glibc/revert-mktime.patch +++ /dev/null @@ -1,73 +0,0 @@ -commit f6d4c1ac648c4ff8baad94500df0bb13108a4f79 -Author: Paul Eggert -Date: Thu Sep 8 20:08:32 2022 -0500 - - REVERT: mktime: improve heuristic for ca-1986 Indiana DST - - This patch syncs mktime.c from Gnulib, fixing a - problem reported by Mark Krenz , - and it should fix BZ#29035 too. - * time/mktime.c (__mktime_internal): Be more generous about - accepting arguments with the wrong value of tm_isdst, by falling - back to a one-hour DST difference if we find no nearby DST that is - unusual. This fixes a problem where "1986-04-28 00:00 EDT" was - rejected when TZ="America/Indianapolis" because the nearest DST - timestamp occurred in 1970, a temporal distance too great for the - old heuristic. This also also narrows the search a bit, which - is a minor performance win. - - (cherry picked from commit 83859e1115269cf56d21669361d4ddbe2687831c) - -diff --git b/time/mktime.c a/time/mktime.c -index e9a6006710..494c89bf54 100644 ---- b/time/mktime.c -+++ a/time/mktime.c -@@ -429,13 +429,8 @@ __mktime_internal (struct tm *tp, - time with the right value, and use its UTC offset. - - Heuristic: probe the adjacent timestamps in both directions, -- looking for the desired isdst. If none is found within a -- reasonable duration bound, assume a one-hour DST difference. -- This should work for all real time zone histories in the tz -- database. */ -- -- /* +1 if we wanted standard time but got DST, -1 if the reverse. */ -- int dst_difference = (isdst == 0) - (tm.tm_isdst == 0); -+ looking for the desired isdst. This should work for all real -+ time zone histories in the tz database. */ - - /* Distance between probes when looking for a DST boundary. In - tzdata2003a, the shortest period of DST is 601200 seconds -@@ -446,14 +441,12 @@ __mktime_internal (struct tm *tp, - periods when probing. */ - int stride = 601200; - -- /* In TZDB 2021e, the longest period of DST (or of non-DST), in -- which the DST (or adjacent DST) difference is not one hour, -- is 457243209 seconds: e.g., America/Cambridge_Bay with leap -- seconds, starting 1965-10-31 00:00 in a switch from -- double-daylight time (-05) to standard time (-07), and -- continuing to 1980-04-27 02:00 in a switch from standard time -- (-07) to daylight time (-06). */ -- int duration_max = 457243209; -+ /* The longest period of DST in tzdata2003a is 536454000 seconds -+ (e.g., America/Jujuy starting 1946-10-01 01:00). The longest -+ period of non-DST is much longer, but it makes no real sense -+ to search for more than a year of non-DST, so use the DST -+ max. */ -+ int duration_max = 536454000; - - /* Search in both directions, so the maximum distance is half - the duration; add the stride to avoid off-by-1 problems. */ -@@ -490,11 +483,6 @@ __mktime_internal (struct tm *tp, - } - } - -- /* No unusual DST offset was found nearby. Assume one-hour DST. */ -- t += 60 * 60 * dst_difference; -- if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm)) -- goto offset_found; -- - __set_errno (EOVERFLOW); - return -1; - } diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index e9f324b24533..1d2ae340a806 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -323,6 +323,11 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs \ scripts/extract-release-date-from-doap-file.py + + # upstream bumps this version check one minor version at a time + # https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-bad/ext/opencv/meson.build#L74 + substituteInPlace ext/opencv/meson.build \ + --replace '< 4.7.0' '< 5.0.0' ''; # This package has some `_("string literal")` string formats diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix index dac712e82387..395708c2a680 100644 --- a/pkgs/development/libraries/gstreamer/base/default.nix +++ b/pkgs/development/libraries/gstreamer/base/default.nix @@ -79,17 +79,16 @@ stdenv.mkDerivation rec { libjpeg tremor libGL + pango ] ++ lib.optionals (!stdenv.isDarwin) [ libvisual ] ++ lib.optionals stdenv.isDarwin [ - pango OpenGL ] ++ lib.optionals enableAlsa [ alsa-lib ] ++ lib.optionals enableX11 [ libXext libXv - pango ] ++ lib.optionals enableWayland [ wayland wayland-protocols diff --git a/pkgs/development/libraries/gtk-sharp/builder.sh b/pkgs/development/libraries/gtk-sharp/builder.sh index 4b8f757540b5..73914495d6d4 100644 --- a/pkgs/development/libraries/gtk-sharp/builder.sh +++ b/pkgs/development/libraries/gtk-sharp/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup genericBuild diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix index 282486dc88d5..112158a47276 100644 --- a/pkgs/development/libraries/gtk/3.x.nix +++ b/pkgs/development/libraries/gtk/3.x.nix @@ -145,6 +145,8 @@ stdenv.mkDerivation rec { libSM libXcomposite libXcursor + libXdamage + libXfixes libXi libXrandr libXrender diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix index 977d39ba3568..9da8e8837bc1 100644 --- a/pkgs/development/libraries/harfbuzz/default.nix +++ b/pkgs/development/libraries/harfbuzz/default.nix @@ -32,23 +32,13 @@ stdenv.mkDerivation rec { pname = "harfbuzz${lib.optionalString withIcu "-icu"}"; - version = "5.3.1"; + version = "6.0.0"; src = fetchurl { url = "https://github.com/harfbuzz/harfbuzz/releases/download/${version}/harfbuzz-${version}.tar.xz"; - sha256 = "sha256-Smzgl7dagSH6zEuoO1sIO/7GV/RbADzVo0JPKua0Q00="; + sha256 = "HRAQoXUdB21SkeQzwThQKnlNZ5p0mNEmjuIeLUoUDrQ="; }; - patches = [ - # Pick upstream patch for exported symbol test failing on darwin - # https://github.com/harfbuzz/harfbuzz/issues/3850 - (fetchpatch { - name = "harfbuzz-fix-check-symbol-tests-lto-and-darwin.patch"; - url = "https://github.com/harfbuzz/harfbuzz/commit/b0b7a65388da25ae3fa01e969ad6abc67eed4f49.patch"; - sha256 = "0my064r88pikw6q70hbgf6hwfkw544b9f5ai73qhn2a3c83jqn06"; - }) - ]; - postPatch = '' patchShebangs src/*.py test '' + lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/libraries/hipcub/default.nix b/pkgs/development/libraries/hipcub/default.nix index 68f31e991d61..d0c7d9a1b053 100644 --- a/pkgs/development/libraries/hipcub/default.nix +++ b/pkgs/development/libraries/hipcub/default.nix @@ -4,9 +4,6 @@ , rocmUpdateScript , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr , rocprim , hip , gtest @@ -18,7 +15,7 @@ # CUB can also be used as a backend instead of rocPRIM. stdenv.mkDerivation (finalAttrs: { pname = "hipcub"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" @@ -42,9 +39,6 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr rocprim ] ++ lib.optionals buildTests [ gtest diff --git a/pkgs/development/libraries/hipsparse/default.nix b/pkgs/development/libraries/hipsparse/default.nix index fc1e62e65208..a4f8a212310a 100644 --- a/pkgs/development/libraries/hipsparse/default.nix +++ b/pkgs/development/libraries/hipsparse/default.nix @@ -4,26 +4,27 @@ , rocmUpdateScript , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr , rocsparse , hip , gfortran , git , gtest +, openmp , buildTests ? false +, buildSamples ? false }: # This can also use cuSPARSE as a backend instead of rocSPARSE stdenv.mkDerivation (finalAttrs: { pname = "hipsparse"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" + ] ++ lib.optionals buildSamples [ + "sample" ]; src = fetchFromGitHub { @@ -41,17 +42,18 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr rocsparse git ] ++ lib.optionals buildTests [ gtest + ] ++ lib.optionals (buildTests || buildSamples) [ + openmp ]; cmakeFlags = [ + "-DCMAKE_C_COMPILER=hipcc" "-DCMAKE_CXX_COMPILER=hipcc" + "-DBUILD_CLIENTS_SAMPLES=${if buildSamples then "ON" else "OFF"}" # Manually define CMAKE_INSTALL_ # See: https://github.com/NixOS/nixpkgs/pull/197838 "-DCMAKE_INSTALL_BINDIR=bin" @@ -110,6 +112,11 @@ stdenv.mkDerivation (finalAttrs: { mv $out/bin/hipsparse-test $test/bin mv /build/source/matrices $test rmdir $out/bin + '' + lib.optionalString buildSamples '' + mkdir -p $sample/bin + mv clients/staging/example_* $sample/bin + patchelf --set-rpath $out/lib:${lib.makeLibraryPath ( + finalAttrs.buildInputs ++ [ hip gfortran.cc ])} $sample/bin/example_* ''; passthru.updateScript = rocmUpdateScript { diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index fc8fb7398701..f9a509ab4862 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -19,11 +19,11 @@ let in stdenv.mkDerivation rec { pname = "${type}krb5"; - version = "1.20"; + version = "1.20.1"; src = fetchurl { url = "https://kerberos.org/dist/krb5/${lib.versions.majorMinor version}/krb5-${version}.tar.gz"; - sha256 = "sha256-fgIr3TyFGDAXP5+qoAaiMKDg/a1MlT6Fv/S/DaA24S8"; + sha256 = "sha256-cErtSbGetacXizSyhzYg7CmdsIdS1qhXT5XUGHmriFE="; }; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix index 066ea8b60ddc..381689f9cb65 100644 --- a/pkgs/development/libraries/libarchive/default.nix +++ b/pkgs/development/libraries/libarchive/default.nix @@ -22,44 +22,48 @@ , cmake , nix , samba +, buildPackages }: +let + autoreconfHook = buildPackages.autoreconfHook269; +in assert xarSupport -> libxml2 != null; - -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "libarchive"; - version = "3.6.1"; + version = "3.6.2"; src = fetchFromGitHub { owner = "libarchive"; repo = "libarchive"; - rev = "v${version}"; - hash = "sha256-G4wL5DDbX0FqaA4cnOlVLZ25ObN8dNsRtxyas29tpDA="; + rev = "v${finalAttrs.version}"; + hash = "sha256-wQbA6vlXH8pnpY7LJLkjrRFEBpcaPR1SqxnK71UVwxg="; }; - postPatch = '' + outputs = [ "out" "lib" "dev" ]; + + postPatch = let + skipTestPaths = [ + # test won't work in nix sandbox + "libarchive/test/test_write_disk_perms.c" + # the filesystem does not necessarily have sparse capabilities + "libarchive/test/test_sparse_basic.c" + # the filesystem does not necessarily have hardlink capabilities + "libarchive/test/test_write_disk_hardlink.c" + # access-time-related tests flakey on some systems + "cpio/test/test_option_a.c" + "cpio/test/test_option_t.c" + ]; + removeTest = testPath: '' + substituteInPlace Makefile.am --replace "${testPath}" "" + rm "${testPath}" + ''; + in '' substituteInPlace Makefile.am --replace '/bin/pwd' "$(type -P pwd)" - declare -a skip_test_paths=( - # test won't work in nix sandbox - 'libarchive/test/test_write_disk_perms.c' - # can't be sure builder will have sparse-capable fs - 'libarchive/test/test_sparse_basic.c' - # can't even be sure builder will have hardlink-capable fs - 'libarchive/test/test_write_disk_hardlink.c' - # access-time-related tests flakey on some systems - 'cpio/test/test_option_a.c' - 'cpio/test/test_option_t.c' - ) - - for test_path in "''${skip_test_paths[@]}" ; do - substituteInPlace Makefile.am --replace "$test_path" "" - rm "$test_path" - done + ${lib.concatStringsSep "\n" (map removeTest skipTestPaths)} ''; - outputs = [ "out" "lib" "dev" ]; - nativeBuildInputs = [ autoreconfHook pkg-config @@ -105,7 +109,7 @@ stdenv.mkDerivation rec { includes implementations of the common tar, cpio, and zcat command-line tools that use the libarchive library. ''; - changelog = "https://github.com/libarchive/libarchive/releases/tag/v${version}"; + changelog = "https://github.com/libarchive/libarchive/releases/tag/v${finalAttrs.version}"; license = licenses.bsd3; maintainers = with maintainers; [ jcumming AndersonTorres ]; platforms = platforms.all; @@ -114,4 +118,4 @@ stdenv.mkDerivation rec { passthru.tests = { inherit cmake nix samba; }; -} +}) diff --git a/pkgs/development/libraries/libavif/default.nix b/pkgs/development/libraries/libavif/default.nix index 64e1657bcba4..dca45186d4ce 100644 --- a/pkgs/development/libraries/libavif/default.nix +++ b/pkgs/development/libraries/libavif/default.nix @@ -12,13 +12,13 @@ stdenv.mkDerivation rec { pname = "libavif"; - version = "0.10.0"; + version = "0.11.1"; src = fetchFromGitHub { owner = "AOMediaCodec"; repo = pname; rev = "v${version}"; - sha256 = "sha256-EGu2avkqQXHFX4gKWsVfVdQN99f4J7Hm86C0sAhuP1Y="; + sha256 = "sha256-mUi0DU99XV3FzUZ8/9uJZU+W3fc6Bk6+y6Z78IRZ9Qs="; }; # reco: encode libaom slowest but best, decode dav1d fastest diff --git a/pkgs/development/libraries/libcamera/default.nix b/pkgs/development/libraries/libcamera/default.nix index ff7cd7a193e3..d03783f2fd90 100644 --- a/pkgs/development/libraries/libcamera/default.nix +++ b/pkgs/development/libraries/libcamera/default.nix @@ -21,12 +21,12 @@ stdenv.mkDerivation rec { pname = "libcamera"; - version = "0.0.1"; + version = "0.0.3"; src = fetchgit { url = "https://git.libcamera.org/libcamera/libcamera.git"; rev = "v${version}"; - hash = "sha256-u5FnfXBCjwSp8QBrH8KIkVGV32/9pff41ZWjWXOwuMI="; + hash = "sha256-0/wvH07bJRKFwYnOARRJNzH8enIX3TNnWQnJdfpfvgE="; }; postPatch = '' diff --git a/pkgs/development/libraries/libclc/default.nix b/pkgs/development/libraries/libclc/default.nix index a53450e11773..14a20a957967 100644 --- a/pkgs/development/libraries/libclc/default.nix +++ b/pkgs/development/libraries/libclc/default.nix @@ -7,13 +7,13 @@ in stdenv.mkDerivation rec { pname = "libclc"; - version = "12.0.1"; + version = "14.0.6"; src = fetchFromGitHub { owner = "llvm"; repo = "llvm-project"; rev = "llvmorg-${version}"; - sha256 = "08s5w2db9imb2yaqsvxs6pg21csi1cf6wa35rf8x6q07mam7j8qv"; + sha256 = "sha256-vffu4HilvYwtzwgq+NlS26m65DGbp6OSSne2aje1yJE="; }; sourceRoot = "source/libclc"; diff --git a/pkgs/development/libraries/libdevil/default.nix b/pkgs/development/libraries/libdevil/default.nix index a79e5371c01b..35637512e0a5 100644 --- a/pkgs/development/libraries/libdevil/default.nix +++ b/pkgs/development/libraries/libdevil/default.nix @@ -1,23 +1,37 @@ -{ lib, stdenv, fetchurl, libjpeg, libpng, libmng, lcms1, libtiff, openexr, libGL -, libX11, pkg-config, OpenGL +{ lib +, stdenv +, fetchurl +, libjpeg +, libpng +, libmng +, lcms1 +, libtiff +, openexr +, libGL +, libX11 +, pkg-config +, OpenGL +, runtimeShell +, withXorg ? true }: stdenv.mkDerivation rec { - pname = "libdevil"; version = "1.7.8"; + outputs = [ "out" "dev" ]; + src = fetchurl { url = "mirror://sourceforge/openil/DevIL-${version}.tar.gz"; sha256 = "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8"; }; - outputs = [ "out" "dev" ]; - - buildInputs = [ libjpeg libpng libmng lcms1 libtiff openexr libGL libX11 ] - ++ lib.optionals stdenv.isDarwin [ OpenGL ]; nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libjpeg libpng libmng lcms1 libtiff openexr ] + ++ lib.optionals withXorg [ libX11 libGL ] + ++ lib.optionals stdenv.isDarwin [ OpenGL ]; + configureFlags = [ "--enable-ILU" "--enable-ILUT" ]; preConfigure = '' @@ -31,29 +45,29 @@ stdenv.mkDerivation rec { sed -i '/RESTRICT_KEYWORD/d' include/IL/config.h ''; - patches = - [ ( fetchurl { + patches = [ + (fetchurl { url = "https://sources.debian.org/data/main/d/devil/1.7.8-10/debian/patches/03_CVE-2009-3994.diff"; sha256 = "0qkx2qfv02igbrmsn6z5a3lbrbwjfh3rb0c2sj54wy0j1f775hbc"; - } ) - ./ftbfs-libpng15.patch - ./il_endian.h.patch - ]; + }) + ./ftbfs-libpng15.patch + ./il_endian.h.patch + ]; enableParallelBuilding = true; postPatch = '' for a in test/Makefile.in test/format_test/format_checks.sh.in ; do substituteInPlace $a \ - --replace /bin/bash ${stdenv.shell} + --replace /bin/bash ${runtimeShell} done ''; meta = with lib; { - homepage = "http://openil.sourceforge.net/"; + homepage = "https://openil.sourceforge.net/"; description = "An image library which can can load, save, convert, manipulate, filter and display a wide variety of image formats"; license = licenses.lgpl2; platforms = platforms.mesaPlatforms; - maintainers = [ ]; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix index c96bc4e41afc..83a426a2afa4 100644 --- a/pkgs/development/libraries/libdrm/default.nix +++ b/pkgs/development/libraries/libdrm/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { the Mesa drivers, the X drivers, libva and similar projects. ''; license = licenses.mit; - platforms = platforms.unix; + platforms = lib.subtractLists platforms.darwin platforms.unix; maintainers = with maintainers; [ primeos ]; }; } diff --git a/pkgs/development/libraries/libksba/default.nix b/pkgs/development/libraries/libksba/default.nix index 5bfb0d029cdf..d7f5aa24c155 100644 --- a/pkgs/development/libraries/libksba/default.nix +++ b/pkgs/development/libraries/libksba/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "libksba"; - version = "1.6.2"; + version = "1.6.3"; src = fetchurl { url = "mirror://gnupg/libksba/libksba-${version}.tar.bz2"; - sha256 = "fce01ccac59812bddadffacff017dac2e4762bdb6ebc6ffe06f6ed4f6192c971"; + hash = "sha256-P3LGjbMJceu/FDZ1J3GUI/Ck1fgQP8n0ocAan6RA3lw="; }; outputs = [ "out" "dev" "info" ]; diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix index 2293dfc00a0c..b757d20b71d5 100644 --- a/pkgs/development/libraries/libpng/default.nix +++ b/pkgs/development/libraries/libpng/default.nix @@ -3,20 +3,20 @@ assert zlib != null; let - patchVersion = "1.6.37"; + patchVersion = "1.6.39"; patch_src = fetchurl { url = "mirror://sourceforge/libpng-apng/libpng-${patchVersion}-apng.patch.gz"; - sha256 = "1dh0250mw9b2hx7cdmnb2blk7ddl49n6vx8zz7jdmiwxy38v4fw2"; + hash = "sha256-SsS26roAzeISxI22XLlCkQc/68oixcef2ocJFQLoDP0="; }; whenPatched = lib.optionalString apngSupport; in stdenv.mkDerivation rec { pname = "libpng" + whenPatched "-apng"; - version = "1.6.37"; + version = "1.6.39"; src = fetchurl { url = "mirror://sourceforge/libpng/libpng-${version}.tar.xz"; - sha256 = "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"; + hash = "sha256-H0aWznC07l+F8eFiPcEimyEAKfpLeu5XPfPiunsDaTc="; }; postPatch = whenPatched "gunzip < ${patch_src} | patch -Np1"; @@ -32,8 +32,9 @@ in stdenv.mkDerivation rec { meta = with lib; { description = "The official reference implementation for the PNG file format" + whenPatched " with animation patch"; homepage = "http://www.libpng.org/pub/png/libpng.html"; + changelog = "https://github.com/glennrp/libpng/blob/v1.6.39/CHANGES"; license = licenses.libpng2; platforms = platforms.all; - maintainers = [ maintainers.vcunat ]; + maintainers = with maintainers; [ vcunat ]; }; } diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix index 6b174a7dfa4d..a60da602e070 100644 --- a/pkgs/development/libraries/librsvg/default.nix +++ b/pkgs/development/libraries/librsvg/default.nix @@ -15,7 +15,7 @@ , rustPlatform , rustc , rust -, cargo +, cargo-auditable-cargo-wrapper , gi-docgen , python3Packages , gnome @@ -57,7 +57,7 @@ stdenv.mkDerivation rec { gdk-pixbuf pkg-config rustc - cargo + cargo-auditable-cargo-wrapper python3Packages.docutils vala rustPlatform.cargoSetupHook diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix index ffed49235286..ac52349a3f13 100644 --- a/pkgs/development/libraries/libtiff/default.nix +++ b/pkgs/development/libraries/libtiff/default.nix @@ -1,9 +1,10 @@ { lib, stdenv -, fetchurl -, fetchpatch +, fetchFromGitLab +, nix-update-script , autoreconfHook , pkg-config +, sphinx , libdeflate , libjpeg @@ -23,11 +24,13 @@ stdenv.mkDerivation rec { pname = "libtiff"; - version = "4.4.0"; + version = "4.5.0"; - src = fetchurl { - url = "https://download.osgeo.org/libtiff/tiff-${version}.tar.gz"; - sha256 = "1vdbk3sc497c58kxmp02irl6nqkfm9rjs3br7g59m59qfnrj6wli"; + src = fetchFromGitLab { + owner = "libtiff"; + repo = "libtiff"; + rev = "v${version}"; + hash = "sha256-KG6rB940JMjFUTAgtkzg+Zh75gylPY6Q7/4gEbL0Hcs="; }; patches = [ @@ -36,32 +39,6 @@ stdenv.mkDerivation rec { # libc++abi 11 has an `#include `, this picks up files name # `version` in the project's include paths ./rename-version.patch - (fetchpatch { - name = "CVE-2022-34526.patch"; - url = "https://gitlab.com/libtiff/libtiff/-/commit/275735d0354e39c0ac1dc3c0db2120d6f31d1990.patch"; - sha256 = "sha256-faKsdJjvQwNdkAKjYm4vubvZvnULt9zz4l53zBFr67s="; - }) - (fetchpatch { - name = "CVE-2022-2953.patch"; - url = "https://gitlab.com/libtiff/libtiff/-/commit/48d6ece8389b01129e7d357f0985c8f938ce3da3.patch"; - sha256 = "sha256-h9hulV+dnsUt/2Rsk4C1AKdULkvweM2ypIJXYQ3BqQU="; - }) - (fetchpatch { - name = "CVE-2022-3626.CVE-2022-3627.CVE-2022-3597.patch"; - url = "https://gitlab.com/libtiff/libtiff/-/commit/236b7191f04c60d09ee836ae13b50f812c841047.patch"; - excludes = [ "doc/tools/tiffcrop.rst" ]; - sha256 = "sha256-L2EMmmfMM4oEYeLapO93wvNS+HlO0yXsKxijXH+Wuas="; - }) - (fetchpatch { - name = "CVE-2022-3598.CVE-2022-3570.patch"; - url = "https://gitlab.com/libtiff/libtiff/-/commit/cfbb883bf6ea7bedcb04177cc4e52d304522fdff.patch"; - sha256 = "sha256-SLq2+JaDEUOPZ5mY4GPB6uwhQOG5cD4qyL5o9i8CVVs="; - }) - (fetchpatch { - name = "CVE-2022-3970.patch"; - url = "https://gitlab.com/libtiff/libtiff/-/commit/227500897dfb07fb7d27f7aa570050e62617e3be.patch"; - sha256 = "sha256-pgItgS+UhMjoSjkDJH5y7iGFZ+yxWKqlL7BdT2mFcH0="; - }) ]; postPatch = '' @@ -71,14 +48,15 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ]; postFixup = '' - moveToOutput include/tif_dir.h $dev_private moveToOutput include/tif_config.h $dev_private + moveToOutput include/tif_dir.h $dev_private + moveToOutput include/tif_hash_set.h $dev_private moveToOutput include/tiffiop.h $dev_private ''; # If you want to change to a different build system, please make # sure cross-compilation works first! - nativeBuildInputs = [ autoreconfHook pkg-config ]; + nativeBuildInputs = [ autoreconfHook pkg-config sphinx ]; propagatedBuildInputs = [ libjpeg xz zlib ]; #TODO: opengl support (bogus configure detection) @@ -88,9 +66,12 @@ stdenv.mkDerivation rec { doCheck = true; - passthru.tests = { - inherit libgeotiff imagemagick graphicsmagick gdal openimageio freeimage imlib; - inherit (python3Packages) pillow imread; + passthru = { + tests = { + inherit libgeotiff imagemagick graphicsmagick gdal openimageio freeimage imlib; + inherit (python3Packages) pillow imread; + }; + updateScript = nix-update-script { }; }; meta = with lib; { diff --git a/pkgs/development/libraries/libtiff/headers.patch b/pkgs/development/libraries/libtiff/headers.patch index e1c681502b33..e0ef9f3478a6 100644 --- a/pkgs/development/libraries/libtiff/headers.patch +++ b/pkgs/development/libraries/libtiff/headers.patch @@ -2,15 +2,16 @@ diff --git i/libtiff/Makefile.am w/libtiff/Makefile.am index 44522b62..d66e5948 100644 --- i/libtiff/Makefile.am +++ w/libtiff/Makefile.am -@@ -36,8 +36,11 @@ EXTRA_DIST = \ +@@ -36,8 +36,12 @@ EXTRA_DIST = \ tiffconf.h.cmake.in - + libtiffinclude_HEADERS = \ + tif_config.h \ + tif_dir.h \ ++ tif_hash_set.h \ tiff.h \ tiffio.h \ + tiffiop.h \ tiffvers.h - + if HAVE_CXX diff --git a/pkgs/development/libraries/libtiff/rename-version.patch b/pkgs/development/libraries/libtiff/rename-version.patch index 30601c0f04ee..ddd33ad49045 100644 --- a/pkgs/development/libraries/libtiff/rename-version.patch +++ b/pkgs/development/libraries/libtiff/rename-version.patch @@ -6,15 +6,15 @@ TODO \ - VERSION + VERSION.txt - + EXTRA_DIST = \ cmake \ -@@ -61,7 +61,7 @@ SUBDIRS = port libtiff tools build contrib test man html - +@@ -61,7 +61,7 @@ SUBDIRS = port libtiff tools build contrib test doc + release: - (rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE) + (rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE) - (rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION) + (rm -f $(top_srcdir)/VERSION.txt && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION.txt) - (rm -f $(top_srcdir)/libtiff/tiffvers.h && sed 's,LIBTIFF_VERSION,$(LIBTIFF_VERSION),;s,LIBTIFF_RELEASE_DATE,$(LIBTIFF_RELEASE_DATE),' $(top_srcdir)/libtiff/tiffvers.h.in > $(top_srcdir)/libtiff/tiffvers.h) - + (rm -f $(top_srcdir)/libtiff/tiffvers.h && sed 's,LIBTIFF_VERSION,$(LIBTIFF_VERSION),;s,LIBTIFF_RELEASE_DATE,$(LIBTIFF_RELEASE_DATE),;s,LIBTIFF_MAJOR_VERSION,$(LIBTIFF_MAJOR_VERSION),;s,LIBTIFF_MINOR_VERSION,$(LIBTIFF_MINOR_VERSION),;s,LIBTIFF_MICRO_VERSION,$(LIBTIFF_MICRO_VERSION),' $(top_srcdir)/libtiff/tiffvers.h.in > $(top_srcdir)/libtiff/tiffvers.h) + pkgconfigdir = $(libdir)/pkgconfig diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix index f7f1633ed446..326ee3028158 100644 --- a/pkgs/development/libraries/libusb1/default.nix +++ b/pkgs/development/libraries/libusb1/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ lib +, stdenv , fetchFromGitHub , fetchpatch , autoreconfHook @@ -8,6 +9,7 @@ , libobjc , IOKit , Security +, withExamples ? false , withStatic ? false }: @@ -31,12 +33,20 @@ stdenv.mkDerivation rec { dontDisableStatic = withStatic; - configureFlags = lib.optional (!enableUdev) "--disable-udev"; + configureFlags = + lib.optional (!enableUdev) "--disable-udev" + ++ lib.optional (withExamples) "--enable-examples-build"; preFixup = lib.optionalString enableUdev '' sed 's,-ludev,-L${lib.getLib udev}/lib -ludev,' -i $out/lib/libusb-1.0.la ''; + postInstall = lib.optionalString withExamples '' + mkdir -p $out/{bin,sbin,examples/bin} + cp -r examples/.libs/* $out/examples/bin + ln -s $out/examples/bin/fxload $out/sbin/fxload + ''; + meta = with lib; { homepage = "https://libusb.info/"; description = "cross-platform user-mode USB device library"; @@ -45,6 +55,6 @@ stdenv.mkDerivation rec { ''; platforms = platforms.all; license = licenses.lgpl21Plus; - maintainers = with maintainers; [ prusnak ]; + maintainers = with maintainers; [ prusnak realsnick ]; }; } diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 78230898d7fc..ea290ed03317 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -19,6 +19,10 @@ , enablePatentEncumberedCodecs ? true , libclc , jdupes +, cmake +, rustc +, rust-bindgen +, spirv-llvm-translator_14 }: /** Packaging design: @@ -37,9 +41,17 @@ with lib; let # Release calendar: https://www.mesa3d.org/release-calendar.html # Release frequency: https://www.mesa3d.org/releasing.html#schedule - version = "22.2.5"; + version = "22.3.2"; branch = versions.major version; + withLibdrm = lib.meta.availableOn stdenv.hostPlatform libdrm; + + rust-bindgen' = rust-bindgen.override { + rust-bindgen-unwrapped = rust-bindgen.unwrapped.override { + clang = llvmPackages.clang; + }; + }; + self = stdenv.mkDerivation { pname = "mesa"; inherit version; @@ -52,7 +64,7 @@ self = stdenv.mkDerivation { "ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz" "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz" ]; - sha256 = "sha256-hQ8GMUb467JirsBPZmwsHlYj8qGYfdok5DYbF7kSxzs="; + sha256 = "c15df758a8795f53e57f2a228eb4593c22b16dffd9b38f83901f76cd9533140b"; }; # TODO: @@ -83,6 +95,10 @@ self = stdenv.mkDerivation { ++ lib.optional stdenv.isLinux "driversdev" ++ lib.optional enableOpenCL "opencl"; + # FIXME: this fixes rusticl/iris segfaulting on startup, _somehow_. + # Needs more investigating. + separateDebugInfo = true; + preConfigure = '' PATH=${llvmPackages.libllvm.dev}/bin:$PATH ''; @@ -105,7 +121,6 @@ self = stdenv.mkDerivation { "-Ddri-drivers-path=${placeholder "drivers"}/lib/dri" "-Dvdpau-libs-path=${placeholder "drivers"}/lib/vdpau" - "-Dxvmc-libs-path=${placeholder "drivers"}/lib" "-Domx-libs-path=${placeholder "drivers"}/lib/bellagio" "-Dva-libs-path=${placeholder "drivers"}/lib/dri" "-Dd3d-drivers-path=${placeholder "drivers"}/lib/d3d" @@ -119,6 +134,7 @@ self = stdenv.mkDerivation { "-Dglvnd=true" ] ++ optionals enableOpenCL [ "-Dgallium-opencl=icd" # Enable the gallium OpenCL frontend + "-Dgallium-rusticl=true" "-Drust_std=2021" "-Dclang-libdir=${llvmPackages.clang-unwrapped.lib}/lib" ] ++ optional enablePatentEncumberedCodecs "-Dvideo-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec" @@ -132,7 +148,7 @@ self = stdenv.mkDerivation { ] ++ lib.optionals (elem "wayland" eglPlatforms) [ wayland wayland-protocols ] ++ lib.optionals stdenv.isLinux [ libomxil-bellagio libva-minimal ] ++ lib.optionals stdenv.isDarwin [ libunwind ] - ++ lib.optionals enableOpenCL [ libclc llvmPackages.clang llvmPackages.clang-unwrapped ] + ++ lib.optionals enableOpenCL [ libclc llvmPackages.clang llvmPackages.clang-unwrapped rustc rust-bindgen' spirv-llvm-translator_14 ] ++ lib.optional withValgrind valgrind-light # Mesa will not build zink when gallium-drivers=auto ++ lib.optional (elem "zink" galliumDrivers) vulkan-loader; @@ -150,7 +166,7 @@ self = stdenv.mkDerivation { propagatedBuildInputs = with xorg; [ libXdamage libXxf86vm - ] ++ optional stdenv.isLinux libdrm + ] ++ optional withLibdrm libdrm ++ optionals stdenv.isDarwin [ OpenGL Xplugin ]; doCheck = false; @@ -188,12 +204,12 @@ self = stdenv.mkDerivation { mkdir -p $opencl/lib mv -t "$opencl/lib/" \ $out/lib/gallium-pipe \ - $out/lib/libMesaOpenCL* + $out/lib/lib*OpenCL* - # We construct our own .icd file that contains an absolute path. - rm -r $out/etc/OpenCL + # We construct our own .icd files that contain absolute paths. mkdir -p $opencl/etc/OpenCL/vendors/ echo $opencl/lib/libMesaOpenCL.so > $opencl/etc/OpenCL/vendors/mesa.icd + echo $opencl/lib/libRusticlOpenCL.so > $opencl/etc/OpenCL/vendors/rusticl.icd '' + lib.optionalString enableOSMesa '' # move libOSMesa to $osmesa, as it's relatively big mkdir -p $osmesa/lib @@ -242,10 +258,11 @@ self = stdenv.mkDerivation { ]; passthru = { - inherit libdrm; inherit (libglvnd) driverLink; inherit llvmPackages; + libdrm = if withLibdrm then libdrm else null; + tests = lib.optionalAttrs stdenv.isLinux { devDoesNotDependOnLLVM = stdenv.mkDerivation { name = "mesa-dev-does-not-depend-on-llvm"; diff --git a/pkgs/development/libraries/mesa/opencl.patch b/pkgs/development/libraries/mesa/opencl.patch index d220239770d5..02558aaa825d 100644 --- a/pkgs/development/libraries/mesa/opencl.patch +++ b/pkgs/development/libraries/mesa/opencl.patch @@ -1,5 +1,18 @@ +diff --git a/meson.build b/meson.build +index e32338b3f9a..fae804fd41e 100644 +--- a/meson.build ++++ b/meson.build +@@ -1894,7 +1894,7 @@ endif + + dep_clang = null_dep + if with_clc +- llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir') ++ llvm_libdir = get_option('clang-libdir') + + dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false) + diff --git a/meson_options.txt b/meson_options.txt -index b8f753e2e1a..2163e3ab7ee 100644 +index 6f307018815..ab84eb1006c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -18,6 +18,12 @@ @@ -16,7 +29,7 @@ index b8f753e2e1a..2163e3ab7ee 100644 'platforms', type : 'array', diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build -index 14df6b86f7f..adcd5110342 100644 +index 7af210b5693..ff6ac8c61ca 100644 --- a/src/gallium/targets/opencl/meson.build +++ b/src/gallium/targets/opencl/meson.build @@ -30,6 +30,7 @@ if with_ld_version_script @@ -29,7 +42,7 @@ index 14df6b86f7f..adcd5110342 100644 polly_dep = null_dep @@ -60,19 +61,19 @@ else endif - if not (dep_clang.found() and dep_clang_usable) + if not _shared_llvm or not (dep_clang.found() and dep_clang_usable) dep_clang = [ - cpp.find_library('clangCodeGen', dirs : llvm_libdir), - cpp.find_library('clangFrontendTool', dirs : llvm_libdir), @@ -60,12 +73,25 @@ index 14df6b86f7f..adcd5110342 100644 polly_dep, polly_isl_dep, ] # check clang once more -@@ -112,7 +113,7 @@ if with_opencl_icd +@@ -119,7 +120,7 @@ if with_opencl_icd + configuration : _config, input : 'mesa.icd.in', output : 'mesa.icd', - install : true, -- install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'), -+ install_dir : join_paths(get_option('prefix'), 'etc', 'OpenCL', 'vendors'), +- install : true, ++ install : false, + install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'), ) - if meson.version().version_compare('>= 0.58') +diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build +index a968dee52db..69475cf3133 100644 +--- a/src/gallium/targets/rusticl/meson.build ++++ b/src/gallium/targets/rusticl/meson.build +@@ -58,7 +58,7 @@ configure_file( + configuration : _config, + input : 'rusticl.icd.in', + output : 'rusticl.icd', +- install : true, ++ install : false, + install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'), + ) + diff --git a/pkgs/development/libraries/miopen/default.nix b/pkgs/development/libraries/miopen/default.nix index d48adb09a04c..1e93c149da8c 100644 --- a/pkgs/development/libraries/miopen/default.nix +++ b/pkgs/development/libraries/miopen/default.nix @@ -6,14 +6,10 @@ , pkg-config , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr -, rocm-opencl-runtime , rocblas , rocmlir , hip -, clang +, clang-tools-extra , clang-ocl , llvm , miopengemm @@ -27,17 +23,12 @@ , doxygen , sphinx , zlib +, gtest +, rocm-comgr , python3Packages , buildDocs ? true , buildTests ? false -# LFS isn't working, so we will manually fetch these -# This isn't strictly required, but is recommended to enable -# https://github.com/ROCmSoftwarePlatform/MIOpen/issues/1373 -# -# MIOpen will produce a very large output due to KDBs fetched -# Also possibly in the future because of KDB generation -# This is disabled by default so we can cache on hydra -, fetchKDBs ? false +, fetchKDBs ? true , useOpenCL ? false }: @@ -62,7 +53,7 @@ let }; in stdenv.mkDerivation (finalAttrs: { pname = "miopen"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" @@ -76,7 +67,7 @@ in stdenv.mkDerivation (finalAttrs: { owner = "ROCmSoftwarePlatform"; repo = "MIOpen"; rev = "rocm-${finalAttrs.version}"; - hash = "sha256-EOe3LUafOeVLzRoahPdS6DMZ/+6WWeVI7jG25zfPrx8="; + hash = "sha256-GfXPCXiVJVve3d8sQCQcFLb/vEnKkVEn7xYUhHkEEVI="; }; nativeBuildInputs = [ @@ -84,15 +75,11 @@ in stdenv.mkDerivation (finalAttrs: { cmake rocm-cmake hip - clang - llvm + clang-tools-extra ]; buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr - rocm-opencl-runtime + llvm rocblas rocmlir clang-ocl @@ -126,8 +113,6 @@ in stdenv.mkDerivation (finalAttrs: { "-DCMAKE_CXX_COMPILER=hipcc" "-DMIOPEN_BACKEND=HIP" ] ++ lib.optionals useOpenCL [ - "-DCMAKE_C_COMPILER=${clang}/bin/clang" - "-DCMAKE_CXX_COMPILER=${clang}/bin/clang++" "-DMIOPEN_BACKEND=OpenCL" ] ++ lib.optionals buildTests [ "-DBUILD_TESTS=ON" @@ -137,37 +122,35 @@ in stdenv.mkDerivation (finalAttrs: { "-DMIOPEN_TEST_GFX908=ON" "-DMIOPEN_TEST_GFX90A=ON" "-DMIOPEN_TEST_GFX103X=ON" + "-DGOOGLETEST_DIR=${gtest.src}" # Custom linker names ]; postPatch = '' substituteInPlace CMakeLists.txt \ --replace "enable_testing()" "" \ --replace "MIOPEN_HIP_COMPILER MATCHES \".*clang\\\\+\\\\+$\"" "true" \ - --replace "/opt/rocm/hip" "${hip}" \ - --replace "/opt/rocm/llvm" "${llvm}" \ - --replace "3 REQUIRED PATHS /opt/rocm)" "3 REQUIRED PATHS ${hip})" \ - --replace "hip REQUIRED PATHS /opt/rocm" "hip REQUIRED PATHS ${hip}" \ - --replace "rocblas REQUIRED PATHS /opt/rocm" "rocblas REQUIRED PATHS ${rocblas}" \ - --replace "miopengemm PATHS /opt/rocm" "miopengemm PATHS ${miopengemm}" \ - --replace "set(MIOPEN_TIDY_ERRORS ALL)" "" # Fix clang-tidy at some point + --replace "set(MIOPEN_TIDY_ERRORS ALL)" "" # error: missing required key 'key' + '' + lib.optionalString buildTests '' + substituteInPlace test/gtest/CMakeLists.txt \ + --replace "enable_testing()" "" '' + lib.optionalString (!buildTests) '' substituteInPlace CMakeLists.txt \ --replace "add_subdirectory(test)" "" '' + lib.optionalString fetchKDBs '' - cp -a ${kdbs.gfx1030_36} src/kernels/gfx1030_36.kdb - cp -a ${kdbs.gfx900_56} src/kernels/gfx900_56.kdb - cp -a ${kdbs.gfx900_64} src/kernels/gfx900_64.kdb - cp -a ${kdbs.gfx906_60} src/kernels/gfx906_60.kdb - cp -a ${kdbs.gfx906_64} src/kernels/gfx906_64.kdb - cp -a ${kdbs.gfx90878} src/kernels/gfx90878.kdb - cp -a ${kdbs.gfx90a68} src/kernels/gfx90a68.kdb - cp -a ${kdbs.gfx90a6e} src/kernels/gfx90a6e.kdb + ln -sf ${kdbs.gfx1030_36} src/kernels/gfx1030_36.kdb + ln -sf ${kdbs.gfx900_56} src/kernels/gfx900_56.kdb + ln -sf ${kdbs.gfx900_64} src/kernels/gfx900_64.kdb + ln -sf ${kdbs.gfx906_60} src/kernels/gfx906_60.kdb + ln -sf ${kdbs.gfx906_64} src/kernels/gfx906_64.kdb + ln -sf ${kdbs.gfx90878} src/kernels/gfx90878.kdb + ln -sf ${kdbs.gfx90a68} src/kernels/gfx90a68.kdb + ln -sf ${kdbs.gfx90a6e} src/kernels/gfx90a6e.kdb ''; # Unfortunately, it seems like we have to call make on these manually postBuild = lib.optionalString buildDocs '' export HOME=$(mktemp -d) - make doc + make -j$NIX_BUILD_CORES doc '' + lib.optionalString buildTests '' make -j$NIX_BUILD_CORES check ''; @@ -180,7 +163,12 @@ in stdenv.mkDerivation (finalAttrs: { '' + lib.optionalString buildTests '' mkdir -p $test/bin mv bin/test_* $test/bin - patchelf --set-rpath ${lib.makeLibraryPath (finalAttrs.buildInputs ++ [ hip ])}:$out/lib $test/bin/* + patchelf --set-rpath $out/lib:${lib.makeLibraryPath (finalAttrs.buildInputs ++ + [ hip rocm-comgr ])} $test/bin/* + '' + lib.optionalString fetchKDBs '' + # Apparently gfx1030_40 wasn't generated so the developers suggest just renaming gfx1030_36 to it + # Should be fixed in the next miopen kernel generation batch + ln -s ${kdbs.gfx1030_36} $out/share/miopen/db/gfx1030_40.kdb ''; passthru.updateScript = rocmUpdateScript { diff --git a/pkgs/development/libraries/miopengemm/default.nix b/pkgs/development/libraries/miopengemm/default.nix index ecc5ba09aad8..45c83021162c 100644 --- a/pkgs/development/libraries/miopengemm/default.nix +++ b/pkgs/development/libraries/miopengemm/default.nix @@ -5,7 +5,6 @@ , cmake , rocm-cmake , rocm-opencl-runtime -, clang , texlive , doxygen , sphinx @@ -32,7 +31,7 @@ let }; in stdenv.mkDerivation (finalAttrs: { pname = "miopengemm"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" @@ -54,7 +53,6 @@ in stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake rocm-cmake - clang ]; buildInputs = [ @@ -70,8 +68,6 @@ in stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ - "-DCMAKE_C_COMPILER=clang" - "-DCMAKE_CXX_COMPILER=clang++" # Manually define CMAKE_INSTALL_ # See: https://github.com/NixOS/nixpkgs/pull/197838 "-DCMAKE_INSTALL_BINDIR=bin" @@ -121,6 +117,6 @@ in stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/ROCmSoftwarePlatform/MIOpenGEMM"; license = with licenses; [ mit ]; maintainers = teams.rocm.members; - broken = finalAttrs.version != clang.version; + broken = finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix index 8e3264dcbc51..f118467b56cf 100644 --- a/pkgs/development/libraries/nghttp2/default.nix +++ b/pkgs/development/libraries/nghttp2/default.nix @@ -31,11 +31,11 @@ assert enableJemalloc -> enableApp; stdenv.mkDerivation rec { pname = "nghttp2"; - version = "1.49.0"; + version = "1.51.0"; src = fetchurl { url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2"; - sha256 = "sha256-LNTbfXX3FJQVMknL6UoJLaTG7NdCQPirGM9kTZ1l9u4="; + sha256 = "sha256-6z6m9bYMbT7b8GXgT0NOjtYpGlyxoHkZxBcwqx/MAOA="; }; outputs = [ "bin" "out" "dev" "lib" ] diff --git a/pkgs/development/libraries/oniguruma/default.nix b/pkgs/development/libraries/oniguruma/default.nix index bc084829e7bb..3062c3cb4e11 100644 --- a/pkgs/development/libraries/oniguruma/default.nix +++ b/pkgs/development/libraries/oniguruma/default.nix @@ -1,16 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook }: +{ lib, stdenv, fetchurl, autoreconfHook }: stdenv.mkDerivation rec { - pname = "onig"; + pname = "oniguruma"; version = "6.9.8"; - src = fetchFromGitHub { - owner = "kkos"; - repo = "oniguruma"; - rev = "v${version}"; - sha256 = "sha256-8aFZdhh6ovLCR0A17rvWq/Oif66rSMnHcCYHjClNElw="; + # Note: do not use fetchpatch or fetchFromGitHub to keep this package available in __bootPackages + src = fetchurl { + url = "https://github.com/kkos/oniguruma/releases/download/v${version}/onig-${version}.tar.gz"; + sha256 = "sha256-KM1iwUZGI8eRBWX7HMqqAQSy/osSvNZG6B9ztHU1IT4="; }; + outputs = [ "dev" "lib" "out" ]; + outputBin = "dev"; # onig-config + nativeBuildInputs = [ autoreconfHook ]; configureFlags = [ "--enable-posix-api=yes" ]; @@ -18,7 +20,7 @@ stdenv.mkDerivation rec { homepage = "https://github.com/kkos/oniguruma"; description = "Regular expressions library"; license = licenses.bsd2; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ artturin ]; platforms = platforms.unix; }; } diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix index 664f39c0c6cd..2c676e008f00 100644 --- a/pkgs/development/libraries/opencv/4.x.nix +++ b/pkgs/development/libraries/opencv/4.x.nix @@ -14,6 +14,7 @@ , config , ocl-icd , buildPackages +, qimgv , enableJPEG ? true , libjpeg @@ -76,20 +77,20 @@ }: let - version = "4.6.0"; + version = "4.7.0"; src = fetchFromGitHub { owner = "opencv"; repo = "opencv"; rev = version; - sha256 = "sha256-zPkMc6xEDZU5TlBH3LAzvB17XgocSPeHVMG/U6kfpxg="; + sha256 = "sha256-jUeGsu8+jzzCnIFbVMCW8DcUeGv/t1yCY/WXyW+uGDI="; }; contribSrc = fetchFromGitHub { owner = "opencv"; repo = "opencv_contrib"; rev = version; - sha256 = "sha256-hjRqT7V4Sz7t4IEy89F5M+b0x2ObBbqF8GWLKhWFXtE="; + sha256 = "sha256-meya0J3RdOIeMM46e/6IOVwrKn3t/c0rhwP2WQaybkE="; }; # Contrib must be built in order to enable Tesseract support: @@ -365,7 +366,12 @@ stdenv.mkDerivation { popd ''; - passthru = lib.optionalAttrs enablePython { pythonPath = [ ]; }; + passthru = { + tests = { + inherit qimgv; + inherit (gst_all_1) gst-plugins-bad; + } // lib.optionalAttrs (!enablePython) { pythonEnabled = pythonPackages.opencv4; }; + } // lib.optionalAttrs enablePython { pythonPath = [ ]; }; meta = with lib; { description = "Open Computer Vision Library with more than 500 algorithms"; diff --git a/pkgs/development/libraries/openssl/3.0/CVE-2022-3996.patch b/pkgs/development/libraries/openssl/3.0/CVE-2022-3996.patch new file mode 100644 index 000000000000..2acedda0e3a4 --- /dev/null +++ b/pkgs/development/libraries/openssl/3.0/CVE-2022-3996.patch @@ -0,0 +1,36 @@ +From 7725e7bfe6f2ce8146b6552b44e0d226be7638e7 Mon Sep 17 00:00:00 2001 +From: Pauli +Date: Fri, 11 Nov 2022 09:40:19 +1100 +Subject: [PATCH] x509: fix double locking problem + +This reverts commit 9aa4be691f5c73eb3c68606d824c104550c053f7 and removed the +redundant flag setting. + +Fixes #19643 + +Fixes LOW CVE-2022-3996 + +Reviewed-by: Dmitry Belyavskiy +Reviewed-by: Tomas Mraz +(Merged from https://github.com/openssl/openssl/pull/19652) + +(cherry picked from commit 4d0340a6d2f327700a059f0b8f954d6160f8eef5) +--- + crypto/x509/pcy_map.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/crypto/x509/pcy_map.c b/crypto/x509/pcy_map.c +index 05406c6493fc..60dfd1e3203b 100644 +--- a/crypto/x509/pcy_map.c ++++ b/crypto/x509/pcy_map.c +@@ -73,10 +73,6 @@ int ossl_policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps) + + ret = 1; + bad_mapping: +- if (ret == -1 && CRYPTO_THREAD_write_lock(x->lock)) { +- x->ex_flags |= EXFLAG_INVALID_POLICY; +- CRYPTO_THREAD_unlock(x->lock); +- } + sk_POLICY_MAPPING_pop_free(maps, POLICY_MAPPING_free); + return ret; + diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 45a34971c8f0..4c322997963a 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -241,6 +241,9 @@ in { (if stdenv.hostPlatform.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch) + + # Remove with 3.0.8 release + ./3.0/CVE-2022-3996.patch ]; withDocs = true; diff --git a/pkgs/development/libraries/pcre2/default.nix b/pkgs/development/libraries/pcre2/default.nix index 226b92ccfdd3..82fc33670bc5 100644 --- a/pkgs/development/libraries/pcre2/default.nix +++ b/pkgs/development/libraries/pcre2/default.nix @@ -6,11 +6,11 @@ stdenv.mkDerivation rec { pname = "pcre2"; - version = "10.40"; + version = "10.42"; src = fetchurl { url = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${version}/pcre2-${version}.tar.bz2"; - hash = "sha256-FOS4PEeDkz3BfpZDGOYyT3yuG8ddjzx5vGlp8AwVnWg="; + hash = "sha256-jTbNjLbqKkwrs1j/ZBGwx4hjOipF2rvxrrS3AdG16EA="; }; configureFlags = [ diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix index 8f0852b06a12..62b6536c047d 100644 --- a/pkgs/development/libraries/pipewire/default.nix +++ b/pkgs/development/libraries/pipewire/default.nix @@ -102,6 +102,19 @@ let ./0090-pipewire-config-template-paths.patch # Place SPA data files in lib output to avoid dependency cycles ./0095-spa-data-dir.patch + + # FIXME: backports, remove after 0.3.64 + # fix bluetooth issues + (fetchpatch { + url = "https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/c7b3ef0d9ff16a1e69a299870860bebcb628e298.patch"; + hash = "sha256-hiZ6VUhMu8NgwX5DZ/JRVl/g1Go0nZQSjQVrmqIzXoY="; + }) + + # fix routes getting lost + (fetchpatch { + url = "https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/89ac6b353521fb9a6d6eb6bb74724c4fa968f75c.patch"; + hash = "sha256-vzHiKWGmyuUF2iDS/ZQws+bCXVYYEl048JaMckY/fGI="; + }) ]; nativeBuildInputs = [ diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix index e9f9120620ac..6d2a56d03ac3 100644 --- a/pkgs/development/libraries/polkit/default.nix +++ b/pkgs/development/libraries/polkit/default.nix @@ -167,7 +167,7 @@ stdenv.mkDerivation rec { rsync --archive "${DESTDIR}${system}"/* "$out" rm --recursive "${DESTDIR}${system}"/* rmdir --parents --ignore-fail-on-non-empty "${DESTDIR}${system}" - for o in $outputs; do + for o in $(getAllOutputNames); do rsync --archive "${DESTDIR}/''${!o}" "$(dirname "''${!o}")" rm --recursive "${DESTDIR}/''${!o}" done diff --git a/pkgs/development/libraries/rccl/default.nix b/pkgs/development/libraries/rccl/default.nix index 6a9b48545749..f501d0e8ced5 100644 --- a/pkgs/development/libraries/rccl/default.nix +++ b/pkgs/development/libraries/rccl/default.nix @@ -4,9 +4,6 @@ , rocmUpdateScript , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr , rocm-smi , hip , gtest @@ -16,7 +13,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "rccl"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" @@ -28,7 +25,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "ROCmSoftwarePlatform"; repo = "rccl"; rev = "rocm-${finalAttrs.version}"; - hash = "sha256-NbHzRmrUe4kJwkHZtZ+zHjIy2uk+dpN9caE0L5hUnbc="; + hash = "sha256-y9gTGk8LyX7owb2xdtb6VlnIXu/CYHOjnNa/wrNl02g="; }; nativeBuildInputs = [ @@ -38,9 +35,6 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr rocm-smi gtest ] ++ lib.optionals buildTests [ diff --git a/pkgs/development/libraries/readline/8.1.nix b/pkgs/development/libraries/readline/8.2.nix similarity index 85% rename from pkgs/development/libraries/readline/8.1.nix rename to pkgs/development/libraries/readline/8.2.nix index 35835c1a1436..0fedcdc9397f 100644 --- a/pkgs/development/libraries/readline/8.1.nix +++ b/pkgs/development/libraries/readline/8.2.nix @@ -3,11 +3,11 @@ stdenv.mkDerivation rec { pname = "readline"; - version = "8.1p${toString (builtins.length upstreamPatches)}"; + version = "8.2p${toString (builtins.length upstreamPatches)}"; src = fetchurl { url = "mirror://gnu/readline/readline-${meta.branch}.tar.gz"; - sha256 = "00ibp0n9crbwx15k9vvckq5wsipw98b1px8pd8i34chy2gpb9kpq"; + sha256 = "sha256-P+txcfFqhO6CyhijbXub4QmlLAT0kqBTMx19EJUAfDU="; }; outputs = [ "out" "dev" "man" "doc" "info" ]; @@ -20,15 +20,15 @@ stdenv.mkDerivation rec { (let patch = nr: sha256: fetchurl { - url = "mirror://gnu/readline/readline-${meta.branch}-patches/readline81-${nr}"; + url = "mirror://gnu/readline/readline-${meta.branch}-patches/readline82-${nr}"; inherit sha256; }; in - import ./readline-8.1-patches.nix patch); + import ./readline-8.2-patches.nix patch); patches = [ ./link-against-ncurses.patch - ./no-arch_only-6.3.patch + ./no-arch_only-8.2.patch ] ++ upstreamPatches; @@ -57,6 +57,6 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ dtzWill ]; platforms = platforms.unix; - branch = "8.1"; + branch = "8.2"; }; } diff --git a/pkgs/development/libraries/readline/no-arch_only-8.2.patch b/pkgs/development/libraries/readline/no-arch_only-8.2.patch new file mode 100644 index 000000000000..06f01ec0891f --- /dev/null +++ b/pkgs/development/libraries/readline/no-arch_only-8.2.patch @@ -0,0 +1,13 @@ +diff -ru -x '*~' readline-6.3-orig/support/shobj-conf readline-6.3/support/shobj-conf +--- support/shobj-conf 2014-02-24 03:06:29.000000000 +0100 ++++ support/shobj-conf 2014-07-22 11:18:52.000000000 +0200 +@@ -159,9 +159,6 @@ + # Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4 + *) + case "${host_os}" in +- darwin[89]*|darwin1[012]*) +- SHOBJ_ARCHFLAGS= +- ;; + *) # Mac OS X 10.9 (Mavericks) and later + SHOBJ_ARCHFLAGS= + # for 32 and 64bit universal library diff --git a/pkgs/development/libraries/readline/readline-8.1-patches.nix b/pkgs/development/libraries/readline/readline-8.1-patches.nix deleted file mode 100644 index b2aaadf0e9b5..000000000000 --- a/pkgs/development/libraries/readline/readline-8.1-patches.nix +++ /dev/null @@ -1,6 +0,0 @@ -# Automatically generated by `update-patch-set.sh'; do not edit. - -patch: [ -(patch "001" "0i4ikdqgcjnb40y2ss3lm09rq56zih5rzma3bib50dk3d1d4cak8") -(patch "002" "1p15sfx5xg5k4lam12lyd0givk7dfjddqpnb1jdp3c4clray0nz5") -] diff --git a/pkgs/development/libraries/readline/readline-8.2-patches.nix b/pkgs/development/libraries/readline/readline-8.2-patches.nix new file mode 100644 index 000000000000..48d2bd14badb --- /dev/null +++ b/pkgs/development/libraries/readline/readline-8.2-patches.nix @@ -0,0 +1,5 @@ +# Automatically generated by `update-patch-set.sh'; do not edit. + +patch: [ +(patch "001" "1xxgfgr6hn3ads8m8xsrdi1kbx1f3s69k0danpd9x4haqhg7zydv") +] diff --git a/pkgs/development/libraries/rocalution/default.nix b/pkgs/development/libraries/rocalution/default.nix new file mode 100644 index 000000000000..30d61391ec99 --- /dev/null +++ b/pkgs/development/libraries/rocalution/default.nix @@ -0,0 +1,114 @@ +{ lib +, stdenv +, fetchFromGitHub +, rocmUpdateScript +, cmake +, rocm-cmake +, rocblas +, rocsparse +, rocprim +, rocrand +, hip +, git +, openmp +, openmpi +, gtest +, buildTests ? false +, buildBenchmarks ? false +, buildSamples ? false +, gpuTargets ? [ ] # gpuTargets = [ "gfx803" "gfx900:xnack-" "gfx906:xnack-" ... ] +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "rocalution"; + version = "5.4.1"; + + outputs = [ + "out" + ] ++ lib.optionals buildTests [ + "test" + ] ++ lib.optionals buildBenchmarks [ + "benchmark" + ] ++ lib.optionals buildSamples [ + "sample" + ]; + + src = fetchFromGitHub { + owner = "ROCmSoftwarePlatform"; + repo = "rocALUTION"; + rev = "rocm-${finalAttrs.version}"; + hash = "sha256-jovhodhNa7tr1bSqpZCKI/9xF7Ie96JB+giqAEfis2k="; + }; + + nativeBuildInputs = [ + cmake + rocm-cmake + hip + git + ]; + + buildInputs = [ + rocblas + rocsparse + rocprim + rocrand + openmp + openmpi + ] ++ lib.optionals buildTests [ + gtest + ]; + + cmakeFlags = [ + "-DCMAKE_CXX_COMPILER=hipcc" + "-DROCM_PATH=${hip}" + "-DHIP_ROOT_DIR=${hip}" + "-DSUPPORT_HIP=ON" + "-DSUPPORT_OMP=ON" + "-DSUPPORT_MPI=ON" + "-DBUILD_CLIENTS_SAMPLES=${if buildSamples then "ON" else "OFF"}" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ] ++ lib.optionals (gpuTargets != [ ]) [ + "-DAMDGPU_TARGETS=${lib.strings.concatStringsSep ";" gpuTargets}" + ] ++ lib.optionals buildTests [ + "-DBUILD_CLIENTS_TESTS=ON" + ] ++ lib.optionals buildBenchmarks [ + "-DBUILD_CLIENTS_BENCHMARKS=ON" + ]; + + postInstall = lib.optionalString buildTests '' + mkdir -p $test/bin + mv $out/bin/rocalution-test $test/bin + '' + lib.optionalString buildBenchmarks '' + mkdir -p $benchmark/bin + mv $out/bin/rocalution-bench $benchmark/bin + '' + lib.optionalString buildSamples '' + mkdir -p $sample/bin + mv clients/staging/* $sample/bin + rm $sample/bin/rocalution-test || true + rm $sample/bin/rocalution-bench || true + + patchelf --set-rpath \ + $out/lib:${lib.makeLibraryPath (finalAttrs.buildInputs ++ [ hip ])} \ + $sample/bin/* + '' + lib.optionalString (buildTests || buildBenchmarks) '' + rmdir $out/bin + ''; + + passthru.updateScript = rocmUpdateScript { + name = finalAttrs.pname; + owner = finalAttrs.src.owner; + repo = finalAttrs.src.repo; + }; + + meta = with lib; { + description = "Iterative sparse solvers for ROCm"; + homepage = "https://github.com/ROCmSoftwarePlatform/rocALUTION"; + license = with licenses; [ mit ]; + maintainers = teams.rocm.members; + broken = finalAttrs.version != hip.version; + }; +}) diff --git a/pkgs/development/libraries/rocblas/default.nix b/pkgs/development/libraries/rocblas/default.nix index 24ead8242005..2d79024c94c9 100644 --- a/pkgs/development/libraries/rocblas/default.nix +++ b/pkgs/development/libraries/rocblas/default.nix @@ -2,20 +2,17 @@ , stdenv , fetchFromGitHub , rocmUpdateScript -, fetchpatch , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr , hip , python3 , tensile , msgpack , libxml2 -, llvm , gtest , gfortran +, openmp +, amd-blis , python3Packages , buildTensile ? true , buildTests ? false @@ -30,7 +27,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocblas"; - version = "5.4.0"; + version = "5.4.1"; + + outputs = [ + "out" + ] ++ lib.optionals buildTests [ + "test" + ] ++ lib.optionals buildBenchmarks [ + "benchmark" + ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; @@ -39,16 +44,6 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-4art8/KwH2KDLwSYcyzn/m/xwdg5wQQvgHks73aB+60="; }; - # We currently need this patch due to faulty toolchain includes - # See: https://github.com/ROCmSoftwarePlatform/rocBLAS/issues/1277 - patches = [ - (fetchpatch { - name = "only-std_norm-from-rocblas_complex.patch"; - url = "https://github.com/ROCmSoftwarePlatform/rocBLAS/commit/44b99c6df26002139ca9ec68ee1fc8899c7b001f.patch"; - hash = "sha256-vSZkVYY951fqfOThKFqnYBasWMblS6peEJZ6sFMCk9k="; - }) - ]; - nativeBuildInputs = [ cmake rocm-cmake @@ -56,19 +51,19 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr python3 ] ++ lib.optionals buildTensile [ msgpack libxml2 - llvm - python3Packages.pyyaml python3Packages.msgpack ] ++ lib.optionals buildTests [ gtest + ] ++ lib.optionals (buildTests || buildBenchmarks) [ gfortran + openmp + amd-blis + ] ++ lib.optionals (buildTensile || buildTests || buildBenchmarks) [ + python3Packages.pyyaml ]; cmakeFlags = [ @@ -95,12 +90,12 @@ stdenv.mkDerivation (finalAttrs: { "-DBUILD_CLIENTS_TESTS=ON" ] ++ lib.optionals buildBenchmarks [ "-DBUILD_CLIENTS_BENCHMARKS=ON" + ] ++ lib.optionals (buildTests || buildBenchmarks) [ + "-DCMAKE_CXX_FLAGS=-I${amd-blis}/include/blis" ]; # Tensile REALLY wants to write to the nix directory if we include it normally - # We need to manually fixup the path so tensile will generate .co and .dat files postPatch = lib.optionalString buildTensile '' - export PATH=${llvm}/bin:$PATH cp -a ${tensile} tensile chmod +w -R tensile @@ -113,6 +108,18 @@ stdenv.mkDerivation (finalAttrs: { --replace "virtualenv_install(\''${Tensile_TEST_LOCAL_PATH})" "" ''; + postInstall = lib.optionalString buildTests '' + mkdir -p $test/bin + cp -a $out/bin/* $test/bin + rm $test/bin/*-bench || true + '' + lib.optionalString buildBenchmarks '' + mkdir -p $benchmark/bin + cp -a $out/bin/* $benchmark/bin + rm $benchmark/bin/*-test || true + '' + lib.optionalString (buildTests || buildBenchmarks ) '' + rm -rf $out/bin + ''; + passthru.updateScript = rocmUpdateScript { name = finalAttrs.pname; owner = finalAttrs.src.owner; @@ -124,8 +131,6 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/ROCmSoftwarePlatform/rocBLAS"; license = with licenses; [ mit ]; maintainers = teams.rocm.members; - # Tests and benchmarks are a can of worms that I will tackle in a different PR - # It involves completely rewriting the amd-blis derivation - broken = finalAttrs.version != hip.version || buildTests || buildBenchmarks; + broken = finalAttrs.version != hip.version; }; }) diff --git a/pkgs/development/libraries/rocclr/default.nix b/pkgs/development/libraries/rocclr/default.nix index 2837f57897e7..01c1522636af 100644 --- a/pkgs/development/libraries/rocclr/default.nix +++ b/pkgs/development/libraries/rocclr/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ lib +, stdenv , fetchFromGitHub , fetchpatch , rocmUpdateScript @@ -7,7 +8,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocclr"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "ROCm-Developer-Tools"; @@ -26,18 +27,19 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - prePatch = '' + postPatch = '' substituteInPlace device/comgrctx.cpp \ --replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so" ''; - buildPhase = ""; + dontConfigure = true; + dontBuild = true; installPhase = '' runHook preInstall mkdir -p $out - cp -r * $out/ + cp -a * $out/ runHook postInstall ''; @@ -57,5 +59,6 @@ stdenv.mkDerivation (finalAttrs: { # to be supported yet by the build infrastructure. Recheck in # the future. platforms = [ "x86_64-linux" ]; + broken = finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/development/libraries/rocfft/default.nix b/pkgs/development/libraries/rocfft/default.nix index 8dbf5f16a447..aad49db494e6 100644 --- a/pkgs/development/libraries/rocfft/default.nix +++ b/pkgs/development/libraries/rocfft/default.nix @@ -4,24 +4,21 @@ , rocmUpdateScript , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr , hip +, openmp , sqlite , python3 , gtest , boost , fftw , fftwFloat -, llvmPackages , buildTests ? false , buildBenchmarks ? false }: stdenv.mkDerivation (finalAttrs: { pname = "rocfft"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" @@ -35,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "ROCmSoftwarePlatform"; repo = "rocFFT"; rev = "rocm-${finalAttrs.version}"; - hash = "sha256-XlpWT6PS+VpJjA4iG8yaiFRxE63kugNG1ZyQXoQVJL8="; + hash = "sha256-NsYeEoBQ/0z31ZQ32l7N+qavWEVkH37snkTHntot7nE="; }; nativeBuildInputs = [ @@ -45,9 +42,6 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr sqlite python3 ] ++ lib.optionals buildTests [ @@ -56,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: { boost fftw fftwFloat - llvmPackages.openmp + openmp ]; propogatedBuildInputs = lib.optionals buildTests [ diff --git a/pkgs/development/libraries/rocm-comgr/default.nix b/pkgs/development/libraries/rocm-comgr/default.nix index 2d26f72fc1b0..fee10be5db50 100644 --- a/pkgs/development/libraries/rocm-comgr/default.nix +++ b/pkgs/development/libraries/rocm-comgr/default.nix @@ -3,14 +3,19 @@ , fetchFromGitHub , rocmUpdateScript , cmake -, clang +, rocm-cmake , rocm-device-libs -, llvm +, libxml2 }: -stdenv.mkDerivation (finalAttrs: { +let + llvmNativeTarget = + if stdenv.isx86_64 then "X86" + else if stdenv.isAarch64 then "AArch64" + else throw "Unsupported ROCm LLVM platform"; +in stdenv.mkDerivation (finalAttrs: { pname = "rocm-comgr"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; @@ -19,21 +24,20 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-qLsrBTeSop7lIQv8gZDwgpvGZJOAq90zsvMi1QpfbAs="; }; - sourceRoot = "source/lib/comgr"; + patches = [ ./cmake.patch ]; + sourceRoot = "${finalAttrs.src.name}/lib/comgr"; - nativeBuildInputs = [ cmake ]; - - buildInputs = [ clang rocm-device-libs llvm ]; - - cmakeFlags = [ - "-DCMAKE_C_COMPILER=${clang}/bin/clang" - "-DCMAKE_CXX_COMPILER=${clang}/bin/clang++" - "-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm" - "-DLLD_INCLUDE_DIRS=${llvm}/include" - "-DLLVM_TARGETS_TO_BUILD=\"AMDGPU;X86\"" + nativeBuildInputs = [ + cmake + rocm-cmake ]; - patches = [ ./cmake.patch ]; + buildInputs = [ + rocm-device-libs + libxml2 + ]; + + cmakeFlags = [ "-DLLVM_TARGETS_TO_BUILD=AMDGPU;X86" ]; passthru.updateScript = rocmUpdateScript { name = finalAttrs.pname; @@ -47,5 +51,6 @@ stdenv.mkDerivation (finalAttrs: { license = licenses.ncsa; maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; platforms = platforms.linux; + broken = finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/development/libraries/rocm-device-libs/default.nix b/pkgs/development/libraries/rocm-device-libs/default.nix index b6245eea8449..6ed70a6565ac 100644 --- a/pkgs/development/libraries/rocm-device-libs/default.nix +++ b/pkgs/development/libraries/rocm-device-libs/default.nix @@ -1,14 +1,20 @@ -{ lib, stdenv +{ lib +, stdenv , fetchFromGitHub , rocmUpdateScript , cmake -, clang -, llvm +, rocm-cmake +, libxml2 }: -stdenv.mkDerivation (finalAttrs: { +let + llvmNativeTarget = + if stdenv.isx86_64 then "X86" + else if stdenv.isAarch64 then "AArch64" + else throw "Unsupported ROCm LLVM platform"; +in stdenv.mkDerivation (finalAttrs: { pname = "rocm-device-libs"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; @@ -17,17 +23,15 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-8gxvgy2GlROxM5qKtZVu5Lxa1FmTIVlBTpfp8rxhNhk="; }; - nativeBuildInputs = [ cmake ]; + patches = [ ./cmake.patch ]; - buildInputs = [ clang llvm ]; - - cmakeFlags = [ - "-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm;${llvm}/lib/cmake/clang" - "-DLLVM_TARGETS_TO_BUILD='AMDGPU;X86'" - "-DCLANG=${clang}/bin/clang" + nativeBuildInputs = [ + cmake + rocm-cmake ]; - patches = [ ./cmake.patch ]; + buildInputs = [ libxml2 ]; + cmakeFlags = [ "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" ]; passthru.updateScript = rocmUpdateScript { name = finalAttrs.pname; @@ -41,5 +45,6 @@ stdenv.mkDerivation (finalAttrs: { license = licenses.ncsa; maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; platforms = platforms.linux; + broken = finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/development/libraries/rocm-opencl-icd/default.nix b/pkgs/development/libraries/rocm-opencl-icd/default.nix index fb78c4f04dd0..4602d3646e47 100644 --- a/pkgs/development/libraries/rocm-opencl-icd/default.nix +++ b/pkgs/development/libraries/rocm-opencl-icd/default.nix @@ -1,4 +1,8 @@ -{ lib, callPackage, stdenv, rocm-opencl-runtime }: +{ lib +, stdenv +, callPackage +, rocm-opencl-runtime +}: stdenv.mkDerivation rec { pname = "rocm-opencl-icd"; @@ -11,12 +15,12 @@ stdenv.mkDerivation rec { echo "${rocm-opencl-runtime}/lib/libamdocl64.so" > $out/etc/OpenCL/vendors/amdocl64.icd ''; - passthru.impureTests = { rocm-opencl = callPackage ./test.nix {}; }; + passthru.impureTests = { rocm-opencl = callPackage ./test.nix { }; }; meta = with lib; { description = "OpenCL ICD definition for AMD GPUs using the ROCm stack"; license = licenses.mit; - maintainers = with maintainers; [ lovesegfault ]; + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; platforms = platforms.linux; }; } diff --git a/pkgs/development/libraries/rocm-opencl-runtime/default.nix b/pkgs/development/libraries/rocm-opencl-runtime/default.nix index 1d250195c23c..5d37c8ad9f25 100644 --- a/pkgs/development/libraries/rocm-opencl-runtime/default.nix +++ b/pkgs/development/libraries/rocm-opencl-runtime/default.nix @@ -1,28 +1,20 @@ -{ stdenv -, lib +{ lib +, stdenv , fetchFromGitHub , rocmUpdateScript , addOpenGLRunpath , cmake -, rocm-cmake -, clang -, glew -, libglvnd -, libX11 -, llvm -, mesa -, numactl -, python3 -, rocclr , rocm-comgr -, rocm-device-libs , rocm-runtime -, rocm-thunk +, rocclr +, glew +, libX11 +, numactl }: stdenv.mkDerivation (finalAttrs: { pname = "rocm-opencl-runtime"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; @@ -31,27 +23,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-E1+Y/fgp5b+7H1LN+O1fwVi0/XRCgvsiSxTY3u/q+8I="; }; - nativeBuildInputs = [ cmake rocm-cmake ]; + nativeBuildInputs = [ cmake ]; buildInputs = [ - clang - glew - libglvnd - libX11 - llvm - mesa - numactl - python3 rocm-comgr - rocm-device-libs rocm-runtime - rocm-thunk + glew + libX11 + numactl ]; cmakeFlags = [ "-DAMD_OPENCL_PATH=${finalAttrs.src}" "-DROCCLR_PATH=${rocclr}" - "-DCPACK_PACKAGING_INSTALL_PREFIX=/opt/rocm/opencl" ]; dontStrip = true; @@ -80,5 +64,6 @@ stdenv.mkDerivation (finalAttrs: { license = with licenses; [ asl20 mit ]; maintainers = with maintainers; [ acowley lovesegfault ] ++ teams.rocm.members; platforms = platforms.linux; + broken = finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/development/libraries/rocm-runtime/default.nix b/pkgs/development/libraries/rocm-runtime/default.nix index 86ddf5b77038..7b4bd6c11ae5 100644 --- a/pkgs/development/libraries/rocm-runtime/default.nix +++ b/pkgs/development/libraries/rocm-runtime/default.nix @@ -1,36 +1,46 @@ -{ stdenv -, lib +{ lib +, stdenv , fetchFromGitHub , rocmUpdateScript -, addOpenGLRunpath -, cmake , pkg-config +, cmake , xxd -, elfutils -, libdrm -, llvm -, numactl , rocm-device-libs -, rocm-thunk }: +, rocm-thunk +, libelf +, libdrm +, numactl +, valgrind +, libxml2 +}: stdenv.mkDerivation (finalAttrs: { pname = "rocm-runtime"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; repo = "ROCR-Runtime"; rev = "rocm-${finalAttrs.version}"; - hash = "sha256-M9kv1Oe5ZZfd9H/+KUJUoK9L1EdyS2qRp2mJDK0dnPE="; + hash = "sha256-JkTXTQmdESHSFbA6HZdMK3pYEApz9aoAlMzdXayzdyY="; }; - sourceRoot = "source/src"; + sourceRoot = "${finalAttrs.src.name}/src"; - nativeBuildInputs = [ cmake pkg-config xxd ]; + nativeBuildInputs = [ + pkg-config + cmake + xxd + ]; - buildInputs = [ elfutils libdrm llvm numactl ]; - - cmakeFlags = [ "-DCMAKE_PREFIX_PATH=${rocm-thunk}" ]; + buildInputs = [ + rocm-thunk + libelf + libdrm + numactl + valgrind + libxml2 + ]; postPatch = '' patchShebangs image/blit_src/create_hsaco_ascii_file.sh @@ -45,7 +55,8 @@ stdenv.mkDerivation (finalAttrs: { ''; fixupPhase = '' - rm -rf $out/hsa + rm -rf $out/hsa/* + ln -s $out/{include,lib} $out/hsa ''; passthru.updateScript = rocmUpdateScript { @@ -59,5 +70,6 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime"; license = with licenses; [ ncsa ]; maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; + broken = finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/development/libraries/rocm-thunk/default.nix b/pkgs/development/libraries/rocm-thunk/default.nix index 6bca7a89fc48..b5825996a44d 100644 --- a/pkgs/development/libraries/rocm-thunk/default.nix +++ b/pkgs/development/libraries/rocm-thunk/default.nix @@ -2,15 +2,17 @@ , stdenv , fetchFromGitHub , rocmUpdateScript -, cmake , pkg-config +, cmake +, rocm-cmake , libdrm , numactl +, valgrind }: stdenv.mkDerivation (finalAttrs: { pname = "rocm-thunk"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; @@ -19,24 +21,25 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-EU5toaKzVeZpdm/YhaQ0bXq0eoYwYQ5qGLUJzxgZVjE="; }; - preConfigure = '' - export cmakeFlags="$cmakeFlags " - ''; + nativeBuildInputs = [ + pkg-config + cmake + rocm-cmake + ]; - nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ + libdrm + numactl + valgrind + ]; - buildInputs = [ libdrm numactl ]; - - # https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/issues/75 - postPatch = '' - substituteInPlace libhsakmt.pc.in \ - --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ - --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ - ''; - - postInstall = '' - cp -r $src/include $out - ''; + cmakeFlags = [ + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ]; passthru.updateScript = rocmUpdateScript { name = finalAttrs.pname; @@ -49,5 +52,6 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface"; license = with licenses; [ bsd2 mit ]; maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; + broken = finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/development/libraries/rocmlir/default.nix b/pkgs/development/libraries/rocmlir/default.nix index e40eb1b813c1..98843fecfcc7 100644 --- a/pkgs/development/libraries/rocmlir/default.nix +++ b/pkgs/development/libraries/rocmlir/default.nix @@ -3,17 +3,36 @@ , fetchFromGitHub , rocmUpdateScript , cmake -, clang +, ninja +, hip +, rocminfo , git , libxml2 , libedit +, zlib +, ncurses , python3 +, buildRockCompiler ? false }: -stdenv.mkDerivation (finalAttrs: { +# Theoretically, we could have our MLIR have an output +# with the source and built objects so that we can just +# use it as the external LLVM repo for this +let + llvmNativeTarget = + if stdenv.isx86_64 then "X86" + else if stdenv.isAarch64 then "AArch64" + else throw "Unsupported ROCm LLVM platform"; +in stdenv.mkDerivation (finalAttrs: { pname = "rocmlir"; version = "5.4.0"; + outputs = [ + "out" + ] ++ lib.optionals (!buildRockCompiler) [ + "external" + ]; + src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "rocMLIR"; @@ -23,7 +42,9 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake - clang + ninja + ] ++ lib.optionals (!buildRockCompiler) [ + hip ]; buildInputs = [ @@ -33,12 +54,39 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - cmakeFlags = [ - "-DCMAKE_C_COMPILER=clang" - "-DCMAKE_CXX_COMPILER=clang++" - "-DBUILD_FAT_LIBROCKCOMPILER=ON" + propagatedBuildInputs = [ + zlib + ncurses ]; + cmakeFlags = [ + "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" + "-DLLVM_ENABLE_ZLIB=ON" + "-DLLVM_ENABLE_TERMINFO=ON" + ] ++ lib.optionals buildRockCompiler [ + "-DBUILD_FAT_LIBROCKCOMPILER=ON" + ] ++ lib.optionals (!buildRockCompiler) [ + "-DROCM_PATH=${rocminfo}" + "-DROCM_TEST_CHIPSET=gfx000" + ]; + + dontBuild = true; + doCheck = true; + + # Certain libs aren't being generated, try enabling tests next update + checkTarget = if buildRockCompiler + then "librockCompiler" + else "check-mlir-miopen-build-only"; + + postInstall = let + libPath = lib.makeLibraryPath [ zlib ncurses hip stdenv.cc.cc ]; + in lib.optionals (!buildRockCompiler) '' + mkdir -p $external/lib + cp -a external/llvm-project/llvm/lib/{*.a*,*.so*} $external/lib + patchelf --set-rpath $external/lib:$out/lib:${libPath} $external/lib/*.so* + patchelf --set-rpath $out/lib:$external/lib:${libPath} $out/{bin/*,lib/*.so*} + ''; + passthru.updateScript = rocmUpdateScript { name = finalAttrs.pname; owner = finalAttrs.src.owner; @@ -52,6 +100,7 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/ROCmSoftwarePlatform/rocMLIR"; license = with licenses; [ asl20 ]; maintainers = teams.rocm.members; - broken = finalAttrs.version != clang.version; + # Once again, they haven't updated the tags... + broken = lib.versions.minor finalAttrs.version != lib.versions.minor stdenv.cc.version; }; }) diff --git a/pkgs/development/libraries/rocprim/default.nix b/pkgs/development/libraries/rocprim/default.nix index 9b5fabf0fb00..88fad249b8c3 100644 --- a/pkgs/development/libraries/rocprim/default.nix +++ b/pkgs/development/libraries/rocprim/default.nix @@ -4,9 +4,6 @@ , rocmUpdateScript , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr , hip , gtest , gbenchmark @@ -16,7 +13,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocprim"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" @@ -39,11 +36,7 @@ stdenv.mkDerivation (finalAttrs: { hip ]; - buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr - ] ++ lib.optionals buildTests [ + buildInputs = lib.optionals buildTests [ gtest ] ++ lib.optionals buildBenchmarks [ gbenchmark diff --git a/pkgs/development/libraries/rocprofiler/0000-dont-require-hsa_amd_aqlprofile.patch b/pkgs/development/libraries/rocprofiler/0000-dont-require-hsa_amd_aqlprofile.patch new file mode 100644 index 000000000000..b70163b08e48 --- /dev/null +++ b/pkgs/development/libraries/rocprofiler/0000-dont-require-hsa_amd_aqlprofile.patch @@ -0,0 +1,20 @@ +diff --git a/src/util/hsa_rsrc_factory.cpp b/src/util/hsa_rsrc_factory.cpp +index 643ff16..c08d98f 100644 +--- a/src/util/hsa_rsrc_factory.cpp ++++ b/src/util/hsa_rsrc_factory.cpp +@@ -127,15 +127,6 @@ HsaRsrcFactory::HsaRsrcFactory(bool initialize_hsa) : initialize_hsa_(initialize + if (cpu_pool_ == NULL) CHECK_STATUS("CPU memory pool is not found", HSA_STATUS_ERROR); + if (kern_arg_pool_ == NULL) CHECK_STATUS("Kern-arg memory pool is not found", HSA_STATUS_ERROR); + +- // Get AqlProfile API table +- aqlprofile_api_ = {0}; +-#ifdef ROCP_LD_AQLPROFILE +- status = LoadAqlProfileLib(&aqlprofile_api_); +-#else +- status = hsa_api_.hsa_system_get_major_extension_table(HSA_EXTENSION_AMD_AQLPROFILE, hsa_ven_amd_aqlprofile_VERSION_MAJOR, sizeof(aqlprofile_api_), &aqlprofile_api_); +-#endif +- CHECK_STATUS("aqlprofile API table load failed", status); +- + // Get Loader API table + loader_api_ = {0}; + status = hsa_api_.hsa_system_get_major_extension_table(HSA_EXTENSION_AMD_LOADER, 1, sizeof(loader_api_), &loader_api_); diff --git a/pkgs/development/libraries/rocprofiler/default.nix b/pkgs/development/libraries/rocprofiler/default.nix new file mode 100644 index 000000000000..d51e5de6966e --- /dev/null +++ b/pkgs/development/libraries/rocprofiler/default.nix @@ -0,0 +1,65 @@ +{ lib +, stdenv +, fetchFromGitHub +, rocmUpdateScript +, cmake +, rocm-runtime +, rocm-thunk +, roctracer +, numactl +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "rocprofiler"; + version = "5.4.1"; + + src = fetchFromGitHub { + owner = "ROCm-Developer-Tools"; + repo = "rocprofiler"; + rev = "rocm-${finalAttrs.version}"; + hash = "sha256-CpD/+soMN8WTeSb5X7dsnZ596PMkw+4EVsVSvFtKCak="; + }; + + patches = [ ./0000-dont-require-hsa_amd_aqlprofile.patch ]; + nativeBuildInputs = [ cmake ]; + + buildInputs = [ + rocm-thunk + rocm-runtime + numactl + ]; + + cmakeFlags = [ + "-DPROF_API_HEADER_PATH=${roctracer.src}/inc/ext" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ]; + + postPatch = '' + patchShebangs bin test + + substituteInPlace cmake_modules/env.cmake \ + --replace "FATAL_ERROR \"AQL_PROFILE" "WARNING \"AQL_PROFILE" + ''; + + postInstall = '' + patchelf --set-rpath $out/lib:${lib.makeLibraryPath finalAttrs.buildInputs} $out/lib/rocprofiler/librocprof-tool.so + ''; + + passthru.updateScript = rocmUpdateScript { + name = finalAttrs.pname; + owner = finalAttrs.src.owner; + repo = finalAttrs.src.repo; + }; + + meta = with lib; { + description = "Profiling with perf-counters and derived metrics"; + homepage = "https://github.com/ROCm-Developer-Tools/rocprofiler"; + license = with licenses; [ mit ]; # mitx11 + maintainers = teams.rocm.members; + broken = finalAttrs.version != stdenv.cc.version; + }; +}) diff --git a/pkgs/development/libraries/rocrand/default.nix b/pkgs/development/libraries/rocrand/default.nix index f0b1cb3e69b6..a3742a5d9725 100644 --- a/pkgs/development/libraries/rocrand/default.nix +++ b/pkgs/development/libraries/rocrand/default.nix @@ -4,9 +4,6 @@ , rocmUpdateScript , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr , hip , gtest , gbenchmark @@ -16,7 +13,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocrand"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" @@ -40,11 +37,7 @@ stdenv.mkDerivation (finalAttrs: { hip ]; - buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr - ] ++ lib.optionals buildTests [ + buildInputs = lib.optionals buildTests [ gtest ] ++ lib.optionals buildBenchmarks [ gbenchmark diff --git a/pkgs/development/libraries/rocsolver/default.nix b/pkgs/development/libraries/rocsolver/default.nix new file mode 100644 index 000000000000..5b3ad6ce24c4 --- /dev/null +++ b/pkgs/development/libraries/rocsolver/default.nix @@ -0,0 +1,92 @@ +{ lib +, stdenv +, fetchFromGitHub +, rocmUpdateScript +, cmake +, rocm-cmake +, rocblas +, hip +, fmt +, gtest +, gfortran +, lapack-reference +, buildTests ? false +, buildBenchmarks ? false +, gpuTargets ? [ ] # gpuTargets = [ "gfx803" "gfx900" "gfx906:xnack-" ] +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "rocsolver"; + version = "5.4.1"; + + outputs = [ + "out" + ] ++ lib.optionals buildTests [ + "test" + ] ++ lib.optionals buildBenchmarks [ + "benchmark" + ]; + + src = fetchFromGitHub { + owner = "ROCmSoftwarePlatform"; + repo = "rocSOLVER"; + rev = "rocm-${finalAttrs.version}"; + hash = "sha256-UHUcA9CVPuYFpE2DTvRrRMMj51yNPo5wMTKnByL2RTg="; + }; + + nativeBuildInputs = [ + cmake + rocm-cmake + hip + ] ++ lib.optionals (buildTests || buildBenchmarks) [ + gfortran + ]; + + buildInputs = [ + rocblas + fmt + ] ++ lib.optionals buildTests [ + gtest + ] ++ lib.optionals (buildTests || buildBenchmarks) [ + lapack-reference + ]; + + cmakeFlags = [ + "-DCMAKE_CXX_COMPILER=hipcc" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ] ++ lib.optionals (gpuTargets != [ ]) [ + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + ] ++ lib.optionals buildTests [ + "-DBUILD_CLIENTS_TESTS=ON" + ] ++ lib.optionals buildBenchmarks [ + "-DBUILD_CLIENTS_BENCHMARKS=ON" + ]; + + postInstall = lib.optionalString buildTests '' + mkdir -p $test/bin + mv $out/bin/rocsolver-test $test/bin + '' + lib.optionalString buildBenchmarks '' + mkdir -p $benchmark/bin + mv $out/bin/rocsolver-bench $benchmark/bin + '' + lib.optionalString (buildTests || buildBenchmarks) '' + rmdir $out/bin + ''; + + passthru.updateScript = rocmUpdateScript { + name = finalAttrs.pname; + owner = finalAttrs.src.owner; + repo = finalAttrs.src.repo; + }; + + meta = with lib; { + description = "ROCm LAPACK implementation"; + homepage = "https://github.com/ROCmSoftwarePlatform/rocSOLVER"; + license = with licenses; [ bsd2 ]; + maintainers = teams.rocm.members; + broken = finalAttrs.version != hip.version; + }; +}) diff --git a/pkgs/development/libraries/rocsparse/default.nix b/pkgs/development/libraries/rocsparse/default.nix index 0edee46cfeb3..0edb0bd14e5e 100644 --- a/pkgs/development/libraries/rocsparse/default.nix +++ b/pkgs/development/libraries/rocsparse/default.nix @@ -5,9 +5,6 @@ , rocmUpdateScript , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr , rocprim , hip , gfortran @@ -21,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocsparse"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" @@ -46,9 +43,6 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr rocprim git ] ++ lib.optionals (buildTests || buildBenchmarks) [ diff --git a/pkgs/development/libraries/rocthrust/default.nix b/pkgs/development/libraries/rocthrust/default.nix index 281620780832..0fc3726761a7 100644 --- a/pkgs/development/libraries/rocthrust/default.nix +++ b/pkgs/development/libraries/rocthrust/default.nix @@ -4,9 +4,6 @@ , rocmUpdateScript , cmake , rocm-cmake -, rocm-runtime -, rocm-device-libs -, rocm-comgr , rocprim , hip , gtest @@ -16,16 +13,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocthrust"; - version = "5.4.0"; + version = "5.4.1"; - # Comment out these outputs until tests/benchmarks are fixed (upstream?) - # outputs = [ - # "out" - # ] ++ lib.optionals buildTests [ - # "test" - # ] ++ lib.optionals buildBenchmarks [ - # "benchmark" - # ]; + outputs = [ + "out" + ] ++ lib.optionals buildTests [ + "test" + ] ++ lib.optionals buildBenchmarks [ + "benchmark" + ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; @@ -41,11 +37,7 @@ stdenv.mkDerivation (finalAttrs: { hip ]; - buildInputs = [ - rocm-runtime - rocm-device-libs - rocm-comgr - ] ++ lib.optionals buildTests [ + buildInputs = lib.optionals buildTests [ gtest ]; @@ -61,18 +53,19 @@ stdenv.mkDerivation (finalAttrs: { "-DBUILD_TEST=ON" ] ++ lib.optionals buildBenchmarks [ "-DBUILD_BENCHMARKS=ON" + ] ++ lib.optionals (buildTests || buildBenchmarks) [ + "-DCMAKE_CXX_FLAGS=-Wno-deprecated-builtins" # Too much spam ]; - # Comment out these outputs until tests/benchmarks are fixed (upstream?) - # postInstall = lib.optionalString buildTests '' - # mkdir -p $test/bin - # mv $out/bin/test_* $test/bin - # '' + lib.optionalString buildBenchmarks '' - # mkdir -p $benchmark/bin - # mv $out/bin/benchmark_* $benchmark/bin - # '' + lib.optionalString (buildTests || buildBenchmarks) '' - # rmdir $out/bin - # ''; + postInstall = lib.optionalString buildTests '' + mkdir -p $test/bin + mv $out/bin/{test_*,*.hip} $test/bin + '' + lib.optionalString buildBenchmarks '' + mkdir -p $benchmark/bin + mv $out/bin/benchmark_* $benchmark/bin + '' + lib.optionalString (buildTests || buildBenchmarks) '' + rm -rf $out/bin + ''; passthru.updateScript = rocmUpdateScript { name = finalAttrs.pname; @@ -85,8 +78,6 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/ROCmSoftwarePlatform/rocThrust"; license = with licenses; [ asl20 ]; maintainers = teams.rocm.members; - # Tests/Benchmarks don't seem to work, thousands of errors compiling with no clear fix - # Is this an upstream issue? We don't seem to be missing dependencies - broken = finalAttrs.version != hip.version || buildTests || buildBenchmarks; + broken = finalAttrs.version != hip.version; }; }) diff --git a/pkgs/development/libraries/roctracer/default.nix b/pkgs/development/libraries/roctracer/default.nix new file mode 100644 index 000000000000..6b5b23fae9f5 --- /dev/null +++ b/pkgs/development/libraries/roctracer/default.nix @@ -0,0 +1,100 @@ +{ lib +, stdenv +, fetchFromGitHub +, rocmUpdateScript +, cmake +, clang +, hip +, rocm-device-libs +, rocprofiler +, libxml2 +, doxygen +, graphviz +, gcc-unwrapped +, rocm-runtime +, python3Packages +, buildDocs ? false # Nothing seems to be generated, so not making the output +, buildTests ? false +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "roctracer"; + version = "5.4.1"; + + outputs = [ + "out" + ] ++ lib.optionals buildDocs [ + "doc" + ] ++ lib.optionals buildTests [ + "test" + ]; + + src = fetchFromGitHub { + owner = "ROCm-Developer-Tools"; + repo = "roctracer"; + rev = "rocm-${finalAttrs.version}"; + hash = "sha256-5vYUNczylB2ehlvhq1u/H8KUXt8ku2E+jawKrKsU7LY="; + }; + + nativeBuildInputs = [ + cmake + clang + hip + ] ++ lib.optionals buildDocs [ + doxygen + graphviz + ]; + + buildInputs = [ + rocm-device-libs + rocprofiler + libxml2 + python3Packages.python + python3Packages.cppheaderparser + ]; + + cmakeFlags = [ + "-DCMAKE_MODULE_PATH=${hip}/hip/cmake" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ]; + + postPatch = '' + export HIP_DEVICE_LIB_PATH=${rocm-device-libs}/amdgcn/bitcode + '' + lib.optionalString (!buildTests) '' + substituteInPlace CMakeLists.txt \ + --replace "add_subdirectory(test)" "" + ''; + + # Tests always fail, probably need GPU + # doCheck = buildTests; + + postInstall = lib.optionalString buildDocs '' + mkdir -p $doc + '' + lib.optionalString buildTests '' + mkdir -p $test/bin + # Not sure why this is an install target + find $out/test -executable -type f -exec mv {} $test/bin \; + rm $test/bin/{*.sh,*.py} + patchelf --set-rpath $out/lib:${lib.makeLibraryPath ( + finalAttrs.buildInputs ++ [ hip gcc-unwrapped.lib rocm-runtime ])} $test/bin/* + rm -rf $out/test + ''; + + passthru.updateScript = rocmUpdateScript { + name = finalAttrs.pname; + owner = finalAttrs.src.owner; + repo = finalAttrs.src.repo; + }; + + meta = with lib; { + description = "Tracer callback/activity library"; + homepage = "https://github.com/ROCm-Developer-Tools/roctracer"; + license = with licenses; [ mit ]; # mitx11 + maintainers = teams.rocm.members; + broken = finalAttrs.version != hip.version; + }; +}) diff --git a/pkgs/development/libraries/rocwmma/0000-dont-fetch-googletest.patch b/pkgs/development/libraries/rocwmma/0000-dont-fetch-googletest.patch index 7208d20a2127..cee603679758 100644 --- a/pkgs/development/libraries/rocwmma/0000-dont-fetch-googletest.patch +++ b/pkgs/development/libraries/rocwmma/0000-dont-fetch-googletest.patch @@ -1,19 +1,31 @@ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index 7e0f2c8..db54eab 100644 +index e1160bb..2a5462e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt -@@ -31,14 +31,6 @@ cmake_dependent_option( ROCWMMA_BUILD_BENCHMARK_TESTS "Build benchmarking tests" +@@ -30,26 +30,6 @@ cmake_dependent_option( ROCWMMA_BUILD_VALIDATION_TESTS "Build validation tests" + cmake_dependent_option( ROCWMMA_BUILD_BENCHMARK_TESTS "Build benchmarking tests" OFF "ROCWMMA_BUILD_TESTS" OFF ) cmake_dependent_option( ROCWMMA_BUILD_EXTENDED_TESTS "Build extended test parameter coverage" OFF "ROCWMMA_BUILD_TESTS" OFF ) - # Test/benchmark requires additional dependencies +-# Test/benchmark requires additional dependencies -include( FetchContent ) - -FetchContent_Declare( - googletest -- URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip +- GIT_REPOSITORY https://github.com/google/googletest.git +- GIT_TAG 609281088cfefc76f9d0ce82e1ff6c30cc3591e5 -) --FetchContent_MakeAvailable(googletest) -- - include(GoogleTest) +-FetchContent_GetProperties(googletest) +-if(NOT googletest_POPULATED) +- # Fetch the content using default details +- FetchContent_Populate(googletest) +- # Save the shared libs setting, then force to static libs +- set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS}) +- set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "Build SHARED libraries" FORCE) +- # Add gtest targets as static libs +- add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) +- # Restore shared libs setting +- set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_OLD} CACHE INTERNAL "Build SHARED libraries" FORCE) +-endif() - set(ROCWMMA_TEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + set(ROCWMMA_TEST_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}) + set(ROCWMMA_COMMON_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hip_device.cpp diff --git a/pkgs/development/libraries/rocwmma/default.nix b/pkgs/development/libraries/rocwmma/default.nix index 786d48ee80ca..ecd802612550 100644 --- a/pkgs/development/libraries/rocwmma/default.nix +++ b/pkgs/development/libraries/rocwmma/default.nix @@ -14,6 +14,8 @@ , python3Packages , buildDocs ? true , buildTests ? false +, buildExtendedTests ? false +, buildBenchmarks ? false , buildSamples ? false , gpuTargets ? [ ] # gpuTargets = [ "gfx908:xnack-" "gfx90a:xnack-" "gfx90a:xnack+" ... ] }: @@ -34,14 +36,16 @@ let }; in stdenv.mkDerivation (finalAttrs: { pname = "rocwmma"; - version = "5.4.0"; + version = "5.4.1"; outputs = [ "out" ] ++ lib.optionals buildDocs [ "doc" - ] ++ lib.optionals buildTests [ + ] ++ lib.optionals (buildTests || buildBenchmarks) [ "test" + ] ++ lib.optionals buildBenchmarks [ + "benchmark" ] ++ lib.optionals buildSamples [ "sample" ]; @@ -53,7 +57,7 @@ in stdenv.mkDerivation (finalAttrs: { hash = "sha256-HUJPb6IahBgl/v+W4kXludBTNAjRm8k6v0jxKAX+qZM="; }; - patches = lib.optionals buildTests [ + patches = lib.optionals (buildTests || buildBenchmarks) [ ./0000-dont-fetch-googletest.patch ]; @@ -65,7 +69,7 @@ in stdenv.mkDerivation (finalAttrs: { buildInputs = [ openmp - ] ++ lib.optionals buildTests [ + ] ++ lib.optionals (buildTests || buildBenchmarks) [ gtest rocblas ] ++ lib.optionals buildDocs [ @@ -78,8 +82,10 @@ in stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DCMAKE_CXX_COMPILER=hipcc" - "-DROCWMMA_BUILD_TESTS=${if buildTests then "ON" else "OFF"}" + "-DROCWMMA_BUILD_TESTS=${if buildTests || buildBenchmarks then "ON" else "OFF"}" + "-DROCWMMA_BUILD_VALIDATION_TESTS=ON" "-DROCWMMA_BUILD_SAMPLES=${if buildSamples then "ON" else "OFF"}" + "-DROCWMMA_VALIDATE_WITH_ROCBLAS=ON" # Manually define CMAKE_INSTALL_ # See: https://github.com/NixOS/nixpkgs/pull/197838 "-DCMAKE_INSTALL_BINDIR=bin" @@ -87,11 +93,10 @@ in stdenv.mkDerivation (finalAttrs: { "-DCMAKE_INSTALL_INCLUDEDIR=include" ] ++ lib.optionals (gpuTargets != [ ]) [ "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" - ] ++ lib.optionals buildTests [ - "-DROCWMMA_BUILD_VALIDATION_TESTS=ON" - "-DROCWMMA_BUILD_BENCHMARK_TESTS=ON" + ] ++ lib.optionals buildExtendedTests [ "-DROCWMMA_BUILD_EXTENDED_TESTS=ON" - "-DROCWMMA_VALIDATE_WITH_ROCBLAS=ON" + ] ++ lib.optionals buildBenchmarks [ + "-DROCWMMA_BUILD_BENCHMARK_TESTS=ON" "-DROCWMMA_BENCHMARK_WITH_ROCBLAS=ON" ]; @@ -109,16 +114,19 @@ in stdenv.mkDerivation (finalAttrs: { postInstall = lib.optionalString buildDocs '' mv ../docs/source/_build/html $out/share/doc/rocwmma mv ../docs/source/_build/latex/rocWMMA.pdf $out/share/doc/rocwmma - '' + lib.optionalString buildTests '' + '' + lib.optionalString (buildTests || buildBenchmarks) '' mkdir -p $test/bin - mv $out/bin/*_test* $test/bin + mv $out/bin/{*_test,*-validate} $test/bin + '' + lib.optionalString buildBenchmarks '' + mkdir -p $benchmark/bin + mv $out/bin/*-bench $benchmark/bin '' + lib.optionalString buildSamples '' mkdir -p $sample/bin mv $out/bin/sgemmv $sample/bin mv $out/bin/simple_gemm $sample/bin mv $out/bin/simple_dlrm $sample/bin - '' + lib.optionalString (buildTests || buildSamples) '' - rmdir $out/bin + '' + lib.optionalString (buildTests || buildBenchmarks || buildSamples) '' + rm -rf $out/bin ''; passthru.updateScript = rocmUpdateScript { @@ -132,8 +140,6 @@ in stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/ROCmSoftwarePlatform/rocWMMA"; license = with licenses; [ mit ]; maintainers = teams.rocm.members; - # Building tests isn't working for now - # undefined reference to symbol '_ZTIN7testing4TestE' - broken = finalAttrs.version != hip.version || buildTests; + broken = finalAttrs.version != hip.version; }; }) diff --git a/pkgs/development/libraries/soundtouch/default.nix b/pkgs/development/libraries/soundtouch/default.nix index 318ead830f9b..c337edfa0917 100644 --- a/pkgs/development/libraries/soundtouch/default.nix +++ b/pkgs/development/libraries/soundtouch/default.nix @@ -2,14 +2,14 @@ stdenv.mkDerivation rec { pname = "soundtouch"; - version = "2.3.1"; + version = "2.3.2"; src = fetchFromGitea { domain = "codeberg.org"; owner = "soundtouch"; repo = "soundtouch"; rev = version; - sha256 = "10znckb8mrnmvwj7vq12732al873qhqw27fpb5f8r0bkjdpcj3vr"; + sha256 = "sha256-+RprzCn0NCueHhDkk2Lgg7Ihw8JDzu25eIVoVZwF+BA="; }; nativeBuildInputs = [ autoconf automake libtool ]; diff --git a/pkgs/development/libraries/spirv-headers/default.nix b/pkgs/development/libraries/spirv-headers/default.nix index 8abdea5249b7..78dc373d4ab6 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.231.0"; + version = "1.3.236.0"; src = fetchFromGitHub { owner = "KhronosGroup"; repo = "SPIRV-Headers"; rev = "sdk-${version}"; - hash = "sha256-lUWgZYGPu+IaLUrbtyC7R0o3Hq/q7C7BE8r7DAsiC30="; + hash = "sha256-eWI1MyIWxcg1JepRsnHBmitehDigDa+dR8kXvIkYejY="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index 5e3e8f362e03..eb27c8c8b9eb 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -17,13 +17,13 @@ in stdenv.mkDerivation rec { pname = "sqlite${optionalString interactive "-interactive"}"; - version = "3.40.0"; + version = "3.40.1"; # nixpkgs-update: no auto update # NB! Make sure to update ./tools.nix src (in the same directory). src = fetchurl { url = "https://sqlite.org/2022/sqlite-autoconf-${archiveVersion version}.tar.gz"; - sha256 = "sha256-AzNVIHbScAx1NSJW6Rx4v1zWJJFYm6DGmu0KgYaJgOc="; + sha256 = "sha256-LF3qIH+lCNdlrx72ILY33LBlcq+m8B8IFb1bv4ZLM9k="; }; outputs = [ "bin" "dev" "out" ]; diff --git a/pkgs/development/libraries/sqlite/tools.nix b/pkgs/development/libraries/sqlite/tools.nix index 1b7fca210faf..bb0a1a7d7393 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.40.0"; + version = "3.40.1"; # nixpkgs-update: no auto update src = assert version == sqlite.version; fetchurl { url = "https://sqlite.org/2022/sqlite-src-${archiveVersion version}.zip"; - sha256 = "sha256-SFUIKBQgUSk+F5/8aoUg9vv9guHNyni5N5L3ZsyJuOI="; + sha256 = "sha256-UGQSaqUNsgw1V4thK1bDEpQlwFBu1NFhDvpKDwG9+NA="; }; nativeBuildInputs = [ unzip ]; diff --git a/pkgs/development/libraries/tensile/default.nix b/pkgs/development/libraries/tensile/default.nix index df3b580c059f..bfef4716e127 100644 --- a/pkgs/development/libraries/tensile/default.nix +++ b/pkgs/development/libraries/tensile/default.nix @@ -10,7 +10,7 @@ buildPythonPackage rec { pname = "tensile"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; @@ -36,5 +36,6 @@ buildPythonPackage rec { homepage = "https://github.com/ROCmSoftwarePlatform/Tensile"; license = with licenses; [ mit ]; maintainers = teams.rocm.members; + broken = version != stdenv.cc.version; }; } diff --git a/pkgs/development/libraries/vulkan-headers/default.nix b/pkgs/development/libraries/vulkan-headers/default.nix index 1db531e3732c..8f1202088e58 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.231.0"; + version = "1.3.236.0"; nativeBuildInputs = [ cmake ]; @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { owner = "KhronosGroup"; repo = "Vulkan-Headers"; rev = "sdk-${version}"; - hash = "sha256-EoD48jBoJmIet4BDC6bYxOsKK2358SZ/NcZeM61q/5g="; + hash = "sha256-b1q9QugFH4lieS8CTOyZ3uoQ7bd44G8NPEwRtUPD+24="; }; meta = with lib; { diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix index 27c1423d94e5..8d38f725a64d 100644 --- a/pkgs/development/libraries/vulkan-loader/default.nix +++ b/pkgs/development/libraries/vulkan-loader/default.nix @@ -3,14 +3,14 @@ stdenv.mkDerivation rec { pname = "vulkan-loader"; - version = "1.3.231.0"; + version = "1.3.236.0"; src = (assert version == vulkan-headers.version; fetchFromGitHub { owner = "KhronosGroup"; repo = "Vulkan-Loader"; rev = "sdk-${version}"; - hash = "sha256-HWaa3JT0znhvqbvZdcsAwy8Dr6HDQp4rgpVmMOuCo0s="; + hash = "sha256-Y6OakowZlb40ZatITQCFBK/qSZqSdgTNew1XUFD/jMo="; }); patches = [ ./fix-pkgconfig.patch ]; diff --git a/pkgs/development/libraries/wayland/default.nix b/pkgs/development/libraries/wayland/default.nix index c9d0a7ad3b7c..bb764d641436 100644 --- a/pkgs/development/libraries/wayland/default.nix +++ b/pkgs/development/libraries/wayland/default.nix @@ -48,8 +48,9 @@ stdenv.mkDerivation rec { separateDebugInfo = true; mesonFlags = [ - "-Dlibraries=${lib.boolToString withLibraries}" "-Ddocumentation=${lib.boolToString withDocumentation}" + "-Dlibraries=${lib.boolToString withLibraries}" + "-Dtests=${lib.boolToString withLibraries}" ]; depsBuildBuild = [ @@ -95,6 +96,8 @@ stdenv.mkDerivation rec { EOF ''; + passthru = { inherit withLibraries; }; + meta = with lib; { description = "Core Wayland window system code and protocol"; longDescription = '' @@ -109,8 +112,6 @@ stdenv.mkDerivation rec { license = licenses.mit; # Expat version platforms = if withLibraries then platforms.linux else platforms.unix; maintainers = with maintainers; [ primeos codyopel qyliss ]; - # big sur doesn't support gcc stdenv and wayland doesn't build with clang - broken = stdenv.isDarwin; }; passthru.version = version; diff --git a/pkgs/development/libraries/wayland/protocols.nix b/pkgs/development/libraries/wayland/protocols.nix index 1d4b62788935..bd94cc6b47ed 100644 --- a/pkgs/development/libraries/wayland/protocols.nix +++ b/pkgs/development/libraries/wayland/protocols.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { pname = "wayland-protocols"; version = "1.31"; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.hostPlatform == stdenv.buildPlatform && wayland.withLibraries; src = fetchurl { url = "https://gitlab.freedesktop.org/wayland/${pname}/-/releases/${version}/downloads/${pname}-${version}.tar.xz"; @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { ''; homepage = "https://gitlab.freedesktop.org/wayland/wayland-protocols"; license = lib.licenses.mit; # Expat version - platforms = lib.platforms.linux; + platforms = lib.platforms.all; maintainers = with lib.maintainers; [ primeos ]; }; diff --git a/pkgs/development/libraries/wtk/builder.sh b/pkgs/development/libraries/wtk/builder.sh index 86f2719537cd..c3ad173b0933 100644 --- a/pkgs/development/libraries/wtk/builder.sh +++ b/pkgs/development/libraries/wtk/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup mkdir unzipped diff --git a/pkgs/development/libraries/x265/default.nix b/pkgs/development/libraries/x265/default.nix index 92f7f11170f6..b63b0101d54b 100644 --- a/pkgs/development/libraries/x265/default.nix +++ b/pkgs/development/libraries/x265/default.nix @@ -35,8 +35,7 @@ let (mkFlag vtuneSupport "ENABLE_VTUNE") (mkFlag werrorSupport "WARNINGS_AS_ERRORS") # Potentially riscv cross could be fixed by providing the correct CMAKE_SYSTEM_PROCESSOR flag - (mkFlag (with stdenv; !(isCross && hostPlatform.isRiscV || isDarwin && isAarch64)) "ENABLE_ASSEMBLY") - ]; + ] ++ lib.optional (isCross && stdenv.hostPlatform.isRiscV) "-DENABLE_ASSEMBLY=OFF"; cmakeStaticLibFlags = [ "-DHIGH_BIT_DEPTH=ON" diff --git a/pkgs/development/libraries/xapian/default.nix b/pkgs/development/libraries/xapian/default.nix index 700fa1d13dd1..3c0a555dd978 100644 --- a/pkgs/development/libraries/xapian/default.nix +++ b/pkgs/development/libraries/xapian/default.nix @@ -26,7 +26,7 @@ let nativeBuildInputs = [ autoreconfHook ]; doCheck = true; - AUTOMATED_TESTING = true; # https://trac.xapian.org/changeset/8be35f5e1/git + env.AUTOMATED_TESTING = true; # https://trac.xapian.org/changeset/8be35f5e1/git patches = lib.optionals stdenv.isDarwin [ ./skip-flaky-darwin-test.patch ]; diff --git a/pkgs/development/libraries/xlibs-wrapper/default.nix b/pkgs/development/libraries/xlibs-wrapper/default.nix deleted file mode 100644 index 5340306de79a..000000000000 --- a/pkgs/development/libraries/xlibs-wrapper/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{lib, stdenv, packages}: - -stdenv.mkDerivation { - name = "xlibs-wrapper"; - - dontBuild = true; - - installPhase = "mkdir -p $out"; - unpackPhase = "sourceRoot=."; - - propagatedBuildInputs = packages; - - preferLocalBuild = true; - - # For compatability with XFree86. - passthru.buildClientLibs = true; - - meta = { - platforms = lib.platforms.unix; - }; -} diff --git a/pkgs/development/nim-packages/fetch-nimble/builder.sh b/pkgs/development/nim-packages/fetch-nimble/builder.sh index 693ab339408e..bc2f9bfc94f1 100644 --- a/pkgs/development/nim-packages/fetch-nimble/builder.sh +++ b/pkgs/development/nim-packages/fetch-nimble/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup export HOME=$NIX_BUILD_TOP diff --git a/pkgs/development/perl-modules/generic/builder.sh b/pkgs/development/perl-modules/generic/builder.sh index 9b42401fc4dc..110094ad8a49 100644 --- a/pkgs/development/perl-modules/generic/builder.sh +++ b/pkgs/development/perl-modules/generic/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup PERL5LIB="$PERL5LIB${PERL5LIB:+:}$out/lib/perl5/site_perl" diff --git a/pkgs/development/perl-modules/generic/default.nix b/pkgs/development/perl-modules/generic/default.nix index 2d1c550d3168..3dca6550ad68 100644 --- a/pkgs/development/perl-modules/generic/default.nix +++ b/pkgs/development/perl-modules/generic/default.nix @@ -24,6 +24,8 @@ # https://metacpan.org/pod/release/XSAWYERX/perl-5.26.0/pod/perldelta.pod#Removal-of-the-current-directory-%28%22.%22%29-from-@INC , PERL_USE_UNSAFE_INC ? "1" +, env ? {} + , ... }@attrs: @@ -43,10 +45,11 @@ lib.throwIf (attrs ? name) "buildPerlPackage: `name` (\"${attrs.name}\") is depr buildInputs = buildInputs ++ [ perl ]; nativeBuildInputs = nativeBuildInputs ++ [ (perl.mini or perl) ]; - fullperl = buildPerl; - inherit outputs src doCheck checkTarget enableParallelBuilding; - inherit PERL_AUTOINSTALL AUTOMATED_TESTING PERL_USE_UNSAFE_INC; + env = { + inherit PERL_AUTOINSTALL AUTOMATED_TESTING PERL_USE_UNSAFE_INC; + fullperl = buildPerl; + } // env; meta = defaultMeta // (attrs.meta or { }); }); diff --git a/pkgs/development/python-modules/aiosignal/default.nix b/pkgs/development/python-modules/aiosignal/default.nix index 9d815dfac059..b7a3bc9d9dee 100644 --- a/pkgs/development/python-modules/aiosignal/default.nix +++ b/pkgs/development/python-modules/aiosignal/default.nix @@ -9,14 +9,16 @@ buildPythonPackage rec { pname = "aiosignal"; - version = "1.2.0"; - disabled = pythonOlder "3.6"; + version = "1.3.1"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "aio-libs"; repo = pname; rev = "v${version}"; - sha256 = "1pamfc2l95s1q86jvmbp17chjy129gk01kwy8xm88d2ijy8s1caq"; + hash = "sha256-vx3Fe28r+0it1UFwyDSD9NNyeIN4tywTyr4pVp49WuU="; }; propagatedBuildInputs = [ @@ -29,16 +31,19 @@ buildPythonPackage rec { ]; postPatch = '' - substituteInPlace pytest.ini \ + substituteInPlace setup.cfg \ --replace "filterwarnings = error" "" \ --replace "--cov=aiosignal" "" ''; - pythonImportsCheck = [ "aiosignal" ]; + pythonImportsCheck = [ + "aiosignal" + ]; meta = with lib; { description = "Python list of registered asynchronous callbacks"; homepage = "https://github.com/aio-libs/aiosignal"; + changelog = "https://github.com/aio-libs/aiosignal/blob/v${version}/CHANGES.rst"; license = with licenses; [ asl20 ]; maintainers = with maintainers; [ fab ]; }; diff --git a/pkgs/development/python-modules/boto3/default.nix b/pkgs/development/python-modules/boto3/default.nix index 698f252909ef..b9aafb7621c2 100644 --- a/pkgs/development/python-modules/boto3/default.nix +++ b/pkgs/development/python-modules/boto3/default.nix @@ -1,50 +1,57 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub , botocore , jmespath , s3transfer -, futures ? null -, docutils -, nose -, mock -, isPy3k +, setuptools +, pytestCheckHook }: buildPythonPackage rec { pname = "boto3"; - version = "1.24.75"; # N.B: if you change this, change botocore and awscli to a matching version + version = "1.26.38"; # N.B: if you change this, change botocore and awscli to a matching version + format = "pyproject"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-e/oiQt+bH6c+F/TX959rIlYPVdXaLifleOWF725LFKc="; + src = fetchFromGitHub { + owner = "boto"; + repo = pname; + rev = version; + hash = "sha256-/QkR6gL0XkXofnFDcKa7J0ZbZbgT0IKnqtq2wcilbEs="; }; - propagatedBuildInputs = [ botocore jmespath s3transfer ] ++ lib.optionals (!isPy3k) [ futures ]; - checkInputs = [ docutils nose mock ]; + propagatedBuildInputs = [ + botocore + jmespath + s3transfer + setuptools + ]; - checkPhase = '' - runHook preCheck - # This method is not in mock. It might have appeared in some versions. - sed -i 's/action.assert_called_once()/self.assertEqual(action.call_count, 1)/' \ - tests/unit/resources/test_factory.py - nosetests -d tests/unit --verbose - runHook postCheck - ''; + doCheck = true; - # Network access - doCheck = false; + checkInputs = [ + pytestCheckHook + ]; - pythonImportsCheck = [ "boto3" ]; + pythonImportsCheck = [ + "boto3" + ]; - meta = { + disabledTestPaths = [ + # Integration tests require networking + "tests/integration" + ]; + + meta = with lib; { homepage = "https://github.com/boto/boto3"; - license = lib.licenses.asl20; + changelog = "https://github.com/boto/boto3/blob/${version}/CHANGELOG.rst"; + license = licenses.asl20; description = "AWS SDK for Python"; longDescription = '' Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2. ''; + maintainers = with maintainers; [ anthonyroussel ]; }; } diff --git a/pkgs/development/python-modules/botocore/default.nix b/pkgs/development/python-modules/botocore/default.nix index c6905d2de667..1d101b368f93 100644 --- a/pkgs/development/python-modules/botocore/default.nix +++ b/pkgs/development/python-modules/botocore/default.nix @@ -4,43 +4,51 @@ , python-dateutil , jmespath , docutils -, simplejson -, mock -, nose , urllib3 +, pytestCheckHook +, jsonschema }: buildPythonPackage rec { pname = "botocore"; - version = "1.27.75"; # N.B: if you change this, change boto3 and awscli to a matching version + version = "1.29.38"; # N.B: if you change this, change boto3 and awscli to a matching version src = fetchPypi { inherit pname version; - sha256 = "sha256-+LHaK0HojFjbUdsMbv9spWQliUjOSlrH6WrDWkabDU8="; + hash = "sha256-K5jH2oZozcAitNila1BoZFTQoQwRUYcC/eQYgdIGGLY="; }; propagatedBuildInputs = [ python-dateutil jmespath docutils - simplejson urllib3 ]; - checkInputs = [ mock nose ]; + checkInputs = [ + pytestCheckHook + jsonschema + ]; - checkPhase = '' - nosetests -v - ''; + doCheck = true; - # Network access - doCheck = false; + disabledTestPaths = [ + # Integration tests require networking + "tests/integration" - pythonImportsCheck = [ "botocore" ]; + # Disable slow tests (only run unit tests) + "tests/functional" + ]; + + pythonImportsCheck = [ + "botocore" + ]; meta = with lib; { homepage = "https://github.com/boto/botocore"; + changelog = "https://github.com/boto/botocore/blob/${version}/CHANGELOG.rst"; license = licenses.asl20; description = "A low-level interface to a growing number of Amazon Web Services"; + maintainers = with maintainers; [ anthonyroussel ]; }; } diff --git a/pkgs/development/python-modules/databases/default.nix b/pkgs/development/python-modules/databases/default.nix index f5edffd3e442..78311fb6e30f 100644 --- a/pkgs/development/python-modules/databases/default.nix +++ b/pkgs/development/python-modules/databases/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { pname = "databases"; - version = "0.6.2"; + version = "0.7.0"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -22,7 +22,7 @@ buildPythonPackage rec { owner = "encode"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-3zgHfYGiO2xWualLa4h8A85qjC32ILadw/47Ul1GTmM="; + hash = "sha256-3RRHXkM8/GoIcO6Y1EZGbnp/X5gzYkW/PV4bzGay6ZI="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/h2/default.nix b/pkgs/development/python-modules/h2/default.nix index 97ccb7b91206..4e6c830c25a2 100644 --- a/pkgs/development/python-modules/h2/default.nix +++ b/pkgs/development/python-modules/h2/default.nix @@ -2,6 +2,7 @@ , buildPythonPackage , pythonOlder , fetchPypi +, fetchpatch , hpack , hyperframe , pytestCheckHook @@ -20,6 +21,15 @@ buildPythonPackage rec { sha256 = "sha256-qDrKCPvnqst5/seIycC6yTY0NWDtnsGLgqE6EsKNKrs="; }; + patches = [ + # https://github.com/python-hyper/h2/pull/1274 + (fetchpatch { + name = "fix-tests-in-python-3.11.patch"; + url = "https://github.com/python-hyper/h2/commit/8952c91606cd014720ccf202a25b5ee1fbed1591.patch"; + hash = "sha256-skAdAVHMZo1xJEqqKa6FOKPvoQQbGUgGsQjE11jIjtw="; + }) + ]; + propagatedBuildInputs = [ hpack hyperframe @@ -30,6 +40,11 @@ buildPythonPackage rec { hypothesis ]; + disabledTests = [ + # timing sensitive + "test_changing_max_frame_size" + ]; + pythonImportsCheck = [ "h2.connection" "h2.config" diff --git a/pkgs/development/python-modules/jsonschema/default.nix b/pkgs/development/python-modules/jsonschema/default.nix index 69dba8bd472e..833a76399edd 100644 --- a/pkgs/development/python-modules/jsonschema/default.nix +++ b/pkgs/development/python-modules/jsonschema/default.nix @@ -15,14 +15,14 @@ buildPythonPackage rec { pname = "jsonschema"; - version = "4.17.0"; + version = "4.17.3"; format = "pyproject"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-W/zyvKFqCHreF+ArKC00r3zNdJ73YkHn+b18DLipQk0="; + sha256 = "sha256-D4ZEN6uLYHa6ZwdFPvj5imoNUSqA6T+KvbZ29zfstg0="; }; postPatch = '' diff --git a/pkgs/development/python-modules/limits/default.nix b/pkgs/development/python-modules/limits/default.nix index 2b4499e29e8e..f298bef4892f 100644 --- a/pkgs/development/python-modules/limits/default.nix +++ b/pkgs/development/python-modules/limits/default.nix @@ -17,7 +17,7 @@ buildPythonPackage rec { pname = "limits"; - version = "2.7.0"; + version = "2.7.2"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -32,7 +32,7 @@ buildPythonPackage rec { postFetch = '' rm "$out/limits/_version.py" ''; - hash = "sha256-TBZElCogPtoR2qX1YjBgpYh99LhrvLHFtr2ogemo9/c="; + hash = "sha256-sL4/BE1qNfR33rZwBcwHo3UeVMfkNz7rwBNF4LBtSIw="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/moto/default.nix b/pkgs/development/python-modules/moto/default.nix index ad8b8c13a692..6de072579772 100644 --- a/pkgs/development/python-modules/moto/default.nix +++ b/pkgs/development/python-modules/moto/default.nix @@ -20,7 +20,6 @@ , openapi-spec-validator , python-dateutil , python-jose -, pytz , pyyaml , requests , responses @@ -37,21 +36,16 @@ buildPythonPackage rec { pname = "moto"; - version = "4.0.3"; + version = "4.0.12"; format = "setuptools"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "sha256-iutWdX5oavPkpj+Qr7yXPLIxrarYfFzonmiTbBCbC+k="; + hash = "sha256-MPjzFljxjNsV62JsjLOgdSDw2MIZMib7yzMmrhL7okY="; }; - postPatch = '' - substituteInPlace setup.py \ - --replace "werkzeug>=0.5,<2.2.0" "werkzeug>=0.5" - ''; - propagatedBuildInputs = [ aws-xray-sdk boto3 @@ -68,7 +62,6 @@ buildPythonPackage rec { openapi-spec-validator python-dateutil python-jose - pytz pyyaml requests responses @@ -139,6 +132,8 @@ buildPythonPackage rec { "tests/test_awslambda/test_lambda_eventsourcemapping.py" "tests/test_awslambda/test_lambda_invoke.py" "tests/test_batch/test_batch_jobs.py" + "tests/test_kinesis/test_kinesis.py" + "tests/test_kinesis/test_kinesis_stream_consumers.py" ]; disabledTests = [ diff --git a/pkgs/development/python-modules/multidict/default.nix b/pkgs/development/python-modules/multidict/default.nix index 6ee071732691..ebc4daae0bc1 100644 --- a/pkgs/development/python-modules/multidict/default.nix +++ b/pkgs/development/python-modules/multidict/default.nix @@ -7,13 +7,15 @@ buildPythonPackage rec { pname = "multidict"; - version = "6.0.2"; + version = "6.0.3"; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.7"; + + format = "setuptools"; src = fetchPypi { inherit pname version; - sha256 = "sha256-X/O9dfOOTEPx9HDy33pNQwuCHEziK+OE4UWctX1rsBM="; + hash = "sha256-JSOikAbANGh+zNPucAk6aXEpo//ocyU107Lfak7MJ50="; }; postPatch = '' @@ -25,6 +27,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "multidict" ]; meta = with lib; { + changelog = "https://github.com/aio-libs/multidict/blob/v${version}/CHANGES.rst"; description = "Multidict implementation"; homepage = "https://github.com/aio-libs/multidict/"; license = licenses.asl20; diff --git a/pkgs/development/python-modules/platformdirs/default.nix b/pkgs/development/python-modules/platformdirs/default.nix index e206c33d34ca..8c0bdb3cb43a 100644 --- a/pkgs/development/python-modules/platformdirs/default.nix +++ b/pkgs/development/python-modules/platformdirs/default.nix @@ -2,16 +2,16 @@ , appdirs , buildPythonPackage , fetchFromGitHub +, hatch-vcs +, hatchling , pytest-mock , pytestCheckHook , pythonOlder -, hatchling -, hatch-vcs }: buildPythonPackage rec { pname = "platformdirs"; - version = "2.5.3"; + version = "2.6.0"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -19,8 +19,8 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = pname; repo = pname; - rev = version; - sha256 = "sha256-OAvhbgmwGhElszUPksXkOgB5Dp/Wcf4s8807CcT7eyM="; + rev = "refs/tags/${version}"; + hash = "sha256-qh5pv+rAFRMMJHr4nhKQ9Ndyvjd2QuSlkIeVcrXPrQI="; }; SETUPTOOLS_SCM_PRETEND_VERSION = version; @@ -41,8 +41,9 @@ buildPythonPackage rec { ]; meta = with lib; { - description = "Python module for determining appropriate platform-specific directories"; + description = "Module for determining appropriate platform-specific directories"; homepage = "https://platformdirs.readthedocs.io/"; + changelog = "https://github.com/platformdirs/platformdirs/releases/tag/${version}"; license = licenses.mit; maintainers = with maintainers; [ fab ]; }; diff --git a/pkgs/development/python-modules/poetry-core/default.nix b/pkgs/development/python-modules/poetry-core/default.nix index e90529dac6d0..c669de8b03f6 100644 --- a/pkgs/development/python-modules/poetry-core/default.nix +++ b/pkgs/development/python-modules/poetry-core/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { pname = "poetry-core"; - version = "1.3.2"; + version = "1.4.0"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -24,7 +24,7 @@ buildPythonPackage rec { owner = "python-poetry"; repo = pname; rev = version; - hash = "sha256-3Ryfq0MwrL/mKP8DmkhLOyFlulf3c73z9fFIzMuqOrg="; + hash = "sha256-SCzs2v0LIgx3vBYTavPqc7uwAQdWsdmkbDyHgIjOxrk="; }; propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [ @@ -58,6 +58,7 @@ buildPythonPackage rec { ]; meta = with lib; { + changelog = "https://github.com/python-poetry/poetry-core/blob/${src.rev}/CHANGELOG.md"; description = "Core utilities for Poetry"; homepage = "https://github.com/python-poetry/poetry-core/"; license = licenses.mit; diff --git a/pkgs/development/python-modules/poetry-plugin-export/default.nix b/pkgs/development/python-modules/poetry-plugin-export/default.nix index bbf6013e4fd3..8711a4a527d0 100644 --- a/pkgs/development/python-modules/poetry-plugin-export/default.nix +++ b/pkgs/development/python-modules/poetry-plugin-export/default.nix @@ -6,14 +6,14 @@ buildPythonPackage rec { pname = "poetry-plugin-export"; - version = "1.1.2"; + version = "1.2.0"; format = "pyproject"; src = fetchFromGitHub { owner = "python-poetry"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-+BDBQwYaiddq3OQDHKmLap3ehWJe+Gh5D3TwuNXycjg="; + hash = "sha256-xrAGjHFYRT6n+r/16b0xyoI7+1Q1Hsw3lEK92UabIqo="; }; postPatch = '' @@ -29,6 +29,7 @@ buildPythonPackage rec { pythonImportsCheck = []; meta = with lib; { + changelog = "https://github.com/python-poetry/poetry-plugin-export/blob/${src.rev}/CHANGELOG.md"; description = "Poetry plugin to export the dependencies to various formats"; license = licenses.mit; homepage = "https://github.com/python-poetry/poetry-plugin-export"; diff --git a/pkgs/development/python-modules/poetry/default.nix b/pkgs/development/python-modules/poetry/default.nix index 2e81f7e55312..ff5d4c91a5d6 100644 --- a/pkgs/development/python-modules/poetry/default.nix +++ b/pkgs/development/python-modules/poetry/default.nix @@ -8,6 +8,7 @@ , deepdiff , dulwich , fetchFromGitHub +, filelock , flatdict , html5lib , httpretty @@ -32,7 +33,9 @@ , requests-toolbelt , shellingham , stdenv +, tomli , tomlkit +, trove-classifiers , urllib3 , virtualenv , xattr @@ -40,7 +43,7 @@ buildPythonPackage rec { pname = "poetry"; - version = "1.2.2"; + version = "1.3.0"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -49,25 +52,19 @@ buildPythonPackage rec { owner = "python-poetry"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-huIjLv1T42HEmePCQNJpKnNxJKdyD9MlEtc2WRPOjRE="; + hash = "sha256-e60lGOu/g3SahArQXUuW8nIFgReILF5/lPOfOn0qz5o="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'crashtest = "^0.3.0"' 'crashtest = "*"' \ - --replace 'xattr = { version = "^0.9.7"' 'xattr = { version = "^0.10.0"' - ''; - nativeBuildInputs = [ installShellFiles ]; propagatedBuildInputs = [ cachecontrol - cachy cleo crashtest dulwich + filelock html5lib jsonschema keyring @@ -81,9 +78,12 @@ buildPythonPackage rec { requests-toolbelt shellingham tomlkit + trove-classifiers virtualenv ] ++ lib.optionals (stdenv.isDarwin) [ xattr + ] ++ lib.optionals (pythonOlder "3.11") [ + tomli ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ] ++ lib.optionals (pythonOlder "3.8") [ @@ -98,6 +98,7 @@ buildPythonPackage rec { ''; checkInputs = [ + cachy deepdiff flatdict pytestCheckHook @@ -142,6 +143,7 @@ buildPythonPackage rec { ]; meta = with lib; { + changelog = "https://github.com/python-poetry/poetry/blob/${src.rev}/CHANGELOG.md"; homepage = "https://python-poetry.org/"; description = "Python dependency management and packaging made easy"; license = licenses.mit; diff --git a/pkgs/development/python-modules/psutil/default.nix b/pkgs/development/python-modules/psutil/default.nix index 01f48e627bd2..b0be35e0c7ba 100644 --- a/pkgs/development/python-modules/psutil/default.nix +++ b/pkgs/development/python-modules/psutil/default.nix @@ -52,6 +52,7 @@ buildPythonPackage rec { "disk_io_counters" "sensors_battery" "user" + "test_disk_partitions" # problematic on Hydra's Linux builders, apparently ]; pythonImportsCheck = [ diff --git a/pkgs/development/python-modules/pybind11/default.nix b/pkgs/development/python-modules/pybind11/default.nix index 642d3c7e97f5..146ffce784fa 100644 --- a/pkgs/development/python-modules/pybind11/default.nix +++ b/pkgs/development/python-modules/pybind11/default.nix @@ -15,13 +15,13 @@ buildPythonPackage rec { pname = "pybind11"; - version = "2.10.1"; + version = "2.10.2"; src = fetchFromGitHub { owner = "pybind"; repo = pname; rev = "v${version}"; - hash = "sha256-9NS0/fLW2zEmEXhI9GfNN3C/CeI5xibFHwMoUebI90U="; + hash = "sha256-YxAkozyWNTKMCIEk3AhHZbRHtzhRrCSB3wh/Qy9CIyU="; }; postPatch = '' diff --git a/pkgs/development/python-modules/pycares/default.nix b/pkgs/development/python-modules/pycares/default.nix index 74dc59aefbe8..84a7cbe1ba42 100644 --- a/pkgs/development/python-modules/pycares/default.nix +++ b/pkgs/development/python-modules/pycares/default.nix @@ -1,18 +1,24 @@ { lib +, aiodns , buildPythonPackage , c-ares , cffi , fetchPypi , idna +, pythonOlder +, tornado }: buildPythonPackage rec { pname = "pycares"; - version = "4.2.2"; + version = "4.3.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-4fV6gAQ3AIBpS9b7lpof/JFxpZxoJNVPeRwbLk0pg4U="; + hash = "sha256-xUJpb22sl46dmRkjhHRaZfgKfZRQUBFR5KdWPgYBDUU="; }; buildInputs = [ @@ -31,11 +37,18 @@ buildPythonPackage rec { # Requires network access doCheck = false; - pythonImportsCheck = [ "pycares" ]; + passthru.tests = { + inherit aiodns tornado; + }; + + pythonImportsCheck = [ + "pycares" + ]; meta = with lib; { description = "Python interface for c-ares"; homepage = "https://github.com/saghul/pycares"; + changelog = "https://github.com/saghul/pycares/releases/tag/pycares-${version}"; license = licenses.mit; maintainers = with maintainers; [ fab ]; }; diff --git a/pkgs/development/python-modules/pyelftools/default.nix b/pkgs/development/python-modules/pyelftools/default.nix index 1f0bcc15b3ea..817a39cedf9e 100644 --- a/pkgs/development/python-modules/pyelftools/default.nix +++ b/pkgs/development/python-modules/pyelftools/default.nix @@ -8,7 +8,7 @@ buildPythonPackage rec { pname = "pyelftools"; - version = "0.28"; + version = "0.29"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -17,14 +17,16 @@ buildPythonPackage rec { owner = "eliben"; repo = pname; rev = "v${version}"; - hash = "sha256-+T5C0ah2oj5E8fWaQbuzYRVgD5bSiUbaArrlxNLojvw="; + hash = "sha256-tPY0C5CoA9hGHeEA/KWQ1RAVT5kqMlAwuWpOSH+KJ9Y="; }; doCheck = stdenv.hostPlatform.system == "x86_64-linux" && stdenv.hostPlatform.isGnu; checkPhase = '' patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" test/external_tools/readelf - ${python.interpreter} test/all_tests.py + ${python.interpreter} test/run_all_unittests.py + ${python.interpreter} test/run_examples_test.py + ${python.interpreter} test/run_readelf_tests.py --parallel ''; pythonImportsCheck = [ @@ -34,6 +36,7 @@ buildPythonPackage rec { meta = with lib; { description = "Python library for analyzing ELF files and DWARF debugging information"; homepage = "https://github.com/eliben/pyelftools"; + changelog = "https://github.com/eliben/pyelftools/blob/v${version}/CHANGES"; license = licenses.publicDomain; maintainers = with maintainers; [ igsha pamplemousse ]; }; diff --git a/pkgs/development/python-modules/pytest-httpserver/default.nix b/pkgs/development/python-modules/pytest-httpserver/default.nix index cba9a9294e7c..eebbcacb5037 100644 --- a/pkgs/development/python-modules/pytest-httpserver/default.nix +++ b/pkgs/development/python-modules/pytest-httpserver/default.nix @@ -1,35 +1,50 @@ { lib , buildPythonPackage -, fetchPypi -, pytest-cov +, fetchFromGitHub +, poetry-core , pytestCheckHook +, pythonOlder , requests +, toml , werkzeug }: buildPythonPackage rec { pname = "pytest-httpserver"; version = "1.0.6"; + format = "pyproject"; - src = fetchPypi { - pname = "pytest_httpserver"; - inherit version; - sha256 = "sha256-kEDQe/WaxF2N49sdRGj9LR1geXXk2kyHLswEAs2/ez4="; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "csernazs"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-LY5Ur0cIcsNrgvyQlY2E479ZzRcuwqTuiT2MtRupVcs="; }; - propagatedBuildInputs = [ werkzeug ]; - - checkInputs = [ - pytest-cov - pytestCheckHook - requests + nativeBuildInputs = [ + poetry-core ]; - pythonImportsCheck = [ "pytest_httpserver" ]; + propagatedBuildInputs = [ + werkzeug + ]; + + checkInputs = [ + pytestCheckHook + requests + toml + ]; + + pythonImportsCheck = [ + "pytest_httpserver" + ]; meta = with lib; { description = "HTTP server for pytest to test HTTP clients"; homepage = "https://www.github.com/csernazs/pytest-httpserver"; + changelog = "https://github.com/csernazs/pytest-httpserver/blob/${version}/CHANGES.rst"; license = with licenses; [ mit ]; maintainers = with maintainers; [ fab ]; }; diff --git a/pkgs/development/python-modules/pytz/default.nix b/pkgs/development/python-modules/pytz/default.nix index 79750bb2435b..374187f9b97e 100644 --- a/pkgs/development/python-modules/pytz/default.nix +++ b/pkgs/development/python-modules/pytz/default.nix @@ -2,11 +2,13 @@ buildPythonPackage rec { pname = "pytz"; - version = "2022.6"; + version = "2022.7"; + + format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-6JUSQGt5PKOfWXG8mZzFOM4SXA5RwnlBvvRWi0YAleI="; + hash = "sha256-fM+ue0ssBnRkpnM8YmFnP9uP0b6QVGA5a5egc+n6aDo="; }; checkInputs = [ unittestCheckHook ]; diff --git a/pkgs/development/python-modules/six/default.nix b/pkgs/development/python-modules/six/default.nix index 24fe639211d1..61e6a178660d 100644 --- a/pkgs/development/python-modules/six/default.nix +++ b/pkgs/development/python-modules/six/default.nix @@ -1,30 +1,31 @@ { lib , buildPythonPackage , fetchPypi -, pytest +, pytestCheckHook }: buildPythonPackage rec { pname = "six"; version = "1.16.0"; + format = "setuptools"; + src = fetchPypi { inherit pname version; sha256 = "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"; }; - checkInputs = [ pytest ]; + checkInputs = [ + pytestCheckHook + ]; - checkPhase = '' - py.test test_six.py - ''; - - # To prevent infinite recursion with pytest - doCheck = false; + pythonImportsCheck = [ "six" ]; meta = { - description = "A Python 2 and 3 compatibility library"; - homepage = "https://pypi.python.org/pypi/six/"; + changelog = "https://github.com/benjaminp/six/blob/${version}/CHANGES"; + description = "Python 2 and 3 compatibility library"; + homepage = "https://github.com/benjaminp/six"; license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; }; } diff --git a/pkgs/development/python-modules/sphinx-automodapi/default.nix b/pkgs/development/python-modules/sphinx-automodapi/default.nix index c8b586d0fc6e..9145cc416e79 100644 --- a/pkgs/development/python-modules/sphinx-automodapi/default.nix +++ b/pkgs/development/python-modules/sphinx-automodapi/default.nix @@ -36,6 +36,9 @@ buildPythonPackage rec { postPatch = '' substituteInPlace "sphinx_automodapi/tests/helpers.py" \ --replace '[0]), None)' "[0]), (None, '${testInventory}'))" + + substituteInPlace "sphinx_automodapi/tests/test_cases.py" \ + --replace '[0]), None)' "[0]), (None, '${testInventory}'))" ''; checkInputs = [ diff --git a/pkgs/development/python-modules/sphinx-markdown-tables/default.nix b/pkgs/development/python-modules/sphinx-markdown-tables/default.nix new file mode 100644 index 000000000000..55fb0b41f43e --- /dev/null +++ b/pkgs/development/python-modules/sphinx-markdown-tables/default.nix @@ -0,0 +1,30 @@ +{ lib +, buildPythonPackage +, fetchPypi +, sphinx +, markdown +}: + +buildPythonPackage rec { + pname = "sphinx-markdown-tables"; + version = "0.0.17"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-a8bT1ADqzP7r0ohEa8CN2DCDNnxYuF1A/mwS1371kvE="; + }; + + propagatedBuildInputs = [ + sphinx + markdown + ]; + + pythonImportsCheck = [ "sphinx_markdown_tables" ]; + + meta = with lib; { + description = "Sphinx extension for rendering tables written in markdown"; + homepage = "https://github.com/ryanfox/sphinx-markdown-tables"; + maintainers = with maintainers; [ Madouura ]; + license = licenses.gpl3; + }; +} diff --git a/pkgs/development/python-modules/sqlalchemy/default.nix b/pkgs/development/python-modules/sqlalchemy/default.nix index 7c842352eb02..989d0380f7a4 100644 --- a/pkgs/development/python-modules/sqlalchemy/default.nix +++ b/pkgs/development/python-modules/sqlalchemy/default.nix @@ -39,12 +39,12 @@ buildPythonPackage rec { pname = "SQLAlchemy"; - version = "1.4.41"; # TODO: check python3Packages.fastapi when updating to >= 1.4.42 + version = "1.4.45"; # TODO: check python3Packages.fastapi when updating to >= 1.4.42 disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-ApL3DReX48VOhi5vMK5HQBRki8nHI+FKL9pzCtsKl5E="; + hash = "sha256-/WmFCGAJOj9p/v4KtW0EHt/f4YUQtT2aLq7LovFfp5U="; }; nativeBuildInputs = lib.optionals (!isPyPy) [ diff --git a/pkgs/development/python-modules/tomlkit/default.nix b/pkgs/development/python-modules/tomlkit/default.nix index 6bd461db75a2..03ccef3a7832 100644 --- a/pkgs/development/python-modules/tomlkit/default.nix +++ b/pkgs/development/python-modules/tomlkit/default.nix @@ -10,11 +10,11 @@ buildPythonPackage rec { pname = "tomlkit"; - version = "0.11.4"; + version = "0.11.6"; src = fetchPypi { inherit pname version; - sha256 = "sha256-MjWpAQ+uVDI+cnw6wG+3IHUv5mNbNCbjedrsYPvUSoM="; + hash = "sha256-cblS5XIWiJN/sCz501TbzweFBmFJ0oVeRFMevdK2XXM="; }; propagatedBuildInputs = @@ -30,6 +30,7 @@ buildPythonPackage rec { meta = with lib; { homepage = "https://github.com/sdispater/tomlkit"; + changelog = "https://github.com/sdispater/tomlkit/blob/${version}/CHANGELOG.md"; description = "Style-preserving TOML library for Python"; license = licenses.mit; maintainers = with maintainers; [ jakewaksbaum ]; diff --git a/pkgs/development/python-modules/trove-classifiers/default.nix b/pkgs/development/python-modules/trove-classifiers/default.nix new file mode 100644 index 000000000000..4e87963e9e8d --- /dev/null +++ b/pkgs/development/python-modules/trove-classifiers/default.nix @@ -0,0 +1,35 @@ +{ lib +, buildPythonPackage +, fetchPypi +, calver +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "trove-classifiers"; + version = "2022.12.1"; + + format = "setuptools"; + + src = fetchPypi { + inherit pname version; + sha256 = "8eccd9c075038ef2ec73276e2422d0dbf4d632f9133f029632d0df35374caf77"; + }; + + nativeBuildInputs = [ + calver + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "trove_classifiers" ]; + + meta = { + description = "Canonical source for classifiers on PyPI"; + homepage = "https://github.com/pypa/trove-classifiers"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/trustme/default.nix b/pkgs/development/python-modules/trustme/default.nix index fb145ac9a99a..649e2de1c179 100644 --- a/pkgs/development/python-modules/trustme/default.nix +++ b/pkgs/development/python-modules/trustme/default.nix @@ -1,5 +1,4 @@ { lib -, stdenv , buildPythonPackage , fetchPypi , isPy3k @@ -21,10 +20,9 @@ buildPythonPackage rec { }; checkInputs = [ - service-identity - pytestCheckHook - ] ++ lib.optionals (!stdenv.isDarwin || !stdenv.isAarch64) [ pyopenssl + pytestCheckHook + service-identity ]; propagatedBuildInputs = [ @@ -34,17 +32,6 @@ buildPythonPackage rec { futures ]; - # aarch64-darwin forbids W+X memory, but this tests depends on it: - # * https://github.com/pyca/pyopenssl/issues/873 - disabledTests = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ - "test_pyopenssl_end_to_end" - ]; - - postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) '' - substituteInPlace "tests/test_trustme.py" \ - --replace "import OpenSSL.SSL" "" - ''; - # Some of the tests use localhost networking. __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/twisted/default.nix b/pkgs/development/python-modules/twisted/default.nix index 03a6045372bb..f90cdeec51cb 100644 --- a/pkgs/development/python-modules/twisted/default.nix +++ b/pkgs/development/python-modules/twisted/default.nix @@ -57,6 +57,13 @@ buildPythonPackage rec { hash = "sha256-Mqy9QKlPX0bntCwQm/riswIlCUVWF4Oot6BZBI8tTTE="; }; + patches = [ + (fetchpatch { + url = "https://github.com/twisted/twisted/pull/11787.diff"; + hash = "sha256-bQgUmbvDa61Vg8p/o/ivfkOAHyj1lTgHkrRVEGLM9aU="; + }) + ]; + __darwinAllowLocalNetworking = true; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/unidecode/default.nix b/pkgs/development/python-modules/unidecode/default.nix index 96e487871aa3..e2ac00de2177 100644 --- a/pkgs/development/python-modules/unidecode/default.nix +++ b/pkgs/development/python-modules/unidecode/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "unidecode"; - version = "1.3.4"; + version = "1.3.6"; format = "setuptools"; disabled = pythonOlder "3.5"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "avian2"; repo = pname; rev = "${pname}-${version}"; - hash = "sha256-2LRV6Egst2bdxefEzfuA9Ef8zMSWvmlCEV/sIzezyPw="; + hash = "sha256-75E2OlrGIxvwR9MeZEB4bDLdFd1SdprCVcBIJCPS3hM="; }; checkInputs = [ @@ -29,7 +29,8 @@ buildPythonPackage rec { meta = with lib; { description = "ASCII transliterations of Unicode text"; - homepage = "https://pypi.python.org/pypi/Unidecode/"; + homepage = "https://github.com/avian2/unidecode"; + changelog = "https://github.com/avian2/unidecode/blob/unidecode-${version}/ChangeLog"; license = licenses.gpl2Plus; maintainers = with maintainers; [ domenkozar ]; }; diff --git a/pkgs/development/python-modules/urllib3/default.nix b/pkgs/development/python-modules/urllib3/default.nix index ec63f5f21ed9..86083a4cc573 100644 --- a/pkgs/development/python-modules/urllib3/default.nix +++ b/pkgs/development/python-modules/urllib3/default.nix @@ -20,12 +20,12 @@ buildPythonPackage rec { pname = "urllib3"; - version = "1.26.12"; + version = "1.26.13"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-P6ls9CPmmHmX/DJq6N85bbKot8ZndH1H3djsupH0p04="; + hash = "sha256-wIPdDc5o2/vhEp1SccuQ+UR96n1SCXxuASYSDFId3qg="; }; # FIXME: remove backwards compatbility hack @@ -64,15 +64,27 @@ buildPythonPackage rec { ]; passthru.optional-dependencies = { - brotli = if isPyPy then [ brotlicffi ] else [ brotli ]; + brotli = if isPyPy then [ + brotlicffi + ] else [ + brotli + ]; # Use carefully since pyopenssl is not supported aarch64-darwin - secure = [ certifi cryptography idna pyopenssl ]; - socks = [ pysocks ]; + secure = [ + certifi + cryptography + idna + pyopenssl + ]; + socks = [ + pysocks + ]; }; meta = with lib; { description = "Powerful, sanity-friendly HTTP client for Python"; homepage = "https://github.com/shazow/urllib3"; + changelog = "https://github.com/urllib3/urllib3/blob/${version}/CHANGES.rst"; license = licenses.mit; maintainers = with maintainers; [ fab ]; }; diff --git a/pkgs/development/python-modules/watchdog/default.nix b/pkgs/development/python-modules/watchdog/default.nix index f42645940aac..b4c8dcaf6b0c 100644 --- a/pkgs/development/python-modules/watchdog/default.nix +++ b/pkgs/development/python-modules/watchdog/default.nix @@ -1,37 +1,36 @@ { lib , stdenv , buildPythonPackage -, fetchPypi -, pathtools -, pyyaml -, flaky -, pytest-timeout -, pytestCheckHook , CoreServices , fetchpatch +, fetchPypi +, flaky +, pathtools +, pytest-timeout +, pytestCheckHook +, pythonOlder +, pyyaml }: buildPythonPackage rec { pname = "watchdog"; - version = "2.1.9"; + version = "2.2.0"; format = "setuptools"; + disabled = pythonOlder "3.7"; + src = fetchPypi { inherit pname version; - sha256 = "sha256-Q84g67NqUfIfo3b3bR1GkkUrJSfM1gGVDWntNrniFgk="; + hash = "sha256-g8+Lxg2cYTtmpMAYBRhz1ic9nkXQQO7QbWqWJBvY7AE="; }; patches = lib.optionals (stdenv.isDarwin && !stdenv.isAarch64) [ ./force-kqueue.patch - ] ++ [ - (fetchpatch { - url = "https://github.com/gorakhargosh/watchdog/commit/255d1e45c17929dd5ba8a6f91aa28771109931cd.patch"; - sha256 = "sha256-gGgEGuB/0g+4Pv1dXMvIdObjqKruWKkxtufS/dzSlY8="; - excludes = [ "changelog.rst" ]; - }) ]; - buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ]; + buildInputs = lib.optionals stdenv.isDarwin [ + CoreServices + ]; propagatedBuildInputs = [ pathtools @@ -70,6 +69,7 @@ buildPythonPackage rec { meta = with lib; { description = "Python API and shell utilities to monitor file system events"; homepage = "https://github.com/gorakhargosh/watchdog"; + changelog = "https://github.com/gorakhargosh/watchdog/blob/v${version}/changelog.rst"; license = licenses.asl20; maintainers = with maintainers; [ goibhniu ]; }; diff --git a/pkgs/development/python-modules/yarl/default.nix b/pkgs/development/python-modules/yarl/default.nix index 249bf974322e..171f6569cfd8 100644 --- a/pkgs/development/python-modules/yarl/default.nix +++ b/pkgs/development/python-modules/yarl/default.nix @@ -10,11 +10,15 @@ buildPythonPackage rec { pname = "yarl"; - version = "1.8.1"; + version = "1.8.2"; + + disabled = pythonOlder "3.7"; + + format = "setuptools"; src = fetchPypi { inherit pname version; - sha256 = "sha256-r4h4RbjC4GDrVgX/crby3SqrenYTeTc/2J0xT0dSq78="; + hash = "sha256-SdQ0AsbjATrQl4YCv2v1MoU1xI0ZIwS5G5ejxnkLFWI="; }; postPatch = '' @@ -44,6 +48,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "yarl" ]; meta = with lib; { + changelog = "https://github.com/aio-libs/yarl/blob/v${version}/CHANGES.rst"; description = "Yet another URL library"; homepage = "https://github.com/aio-libs/yarl"; license = licenses.asl20; diff --git a/pkgs/development/rocm-modules/update-script/default.nix b/pkgs/development/rocm-modules/update-script/default.nix index 1d2b268a34b6..6188587de31a 100644 --- a/pkgs/development/rocm-modules/update-script/default.nix +++ b/pkgs/development/rocm-modules/update-script/default.nix @@ -1,4 +1,4 @@ -{ runtimeShell +{ lib , writeScript }: @@ -10,6 +10,11 @@ }: let + pname = + if lib.hasPrefix "rocm-llvm-" name + then "llvmPackages_rocm.${lib.removePrefix "rocm-llvm-" name}" + else name; + updateScript = writeScript "update.sh" '' #!/usr/bin/env nix-shell #!nix-shell -i bash -p curl jq common-updater-scripts @@ -22,6 +27,6 @@ let version="''${version}.0" fi - update-source-version ${name} "$version" --ignore-same-hash + update-source-version ${pname} "$version" --ignore-same-hash ''; in [ updateScript ] diff --git a/pkgs/development/tools/build-managers/apache-maven/builder.sh b/pkgs/development/tools/build-managers/apache-maven/builder.sh index dcc38b9ec74a..96fe8ebfac29 100644 --- a/pkgs/development/tools/build-managers/apache-maven/builder.sh +++ b/pkgs/development/tools/build-managers/apache-maven/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup unpackPhase diff --git a/pkgs/development/tools/build-managers/boot/builder.sh b/pkgs/development/tools/build-managers/boot/builder.sh index c1481dc6a144..e007cbac9582 100644 --- a/pkgs/development/tools/build-managers/boot/builder.sh +++ b/pkgs/development/tools/build-managers/boot/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup boot_bin=$out/bin/boot diff --git a/pkgs/development/tools/build-managers/rocm-cmake/default.nix b/pkgs/development/tools/build-managers/rocm-cmake/default.nix index 0a3e44e02299..6fd4c2b58868 100644 --- a/pkgs/development/tools/build-managers/rocm-cmake/default.nix +++ b/pkgs/development/tools/build-managers/rocm-cmake/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocm-cmake"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; @@ -30,5 +30,6 @@ stdenv.mkDerivation (finalAttrs: { license = licenses.mit; maintainers = teams.rocm.members; platforms = platforms.unix; + broken = finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/development/tools/jq/default.nix b/pkgs/development/tools/jq/default.nix index 5671f5dbe641..6b41cc9862b9 100644 --- a/pkgs/development/tools/jq/default.nix +++ b/pkgs/development/tools/jq/default.nix @@ -1,7 +1,6 @@ { lib , stdenv -, fetchpatch -, fetchFromGitHub +, fetchurl , autoreconfHook , onigurumaSupport ? true , oniguruma @@ -11,19 +10,14 @@ stdenv.mkDerivation rec { pname = "jq"; version = "1.6"; - src = fetchFromGitHub { - owner = "stedolan"; - repo = "jq"; - rev = "${pname}-${version}"; - hash = "sha256-CIE8vumQPGK+TFAncmpBijANpFALLTadOvkob0gVzro"; + # Note: do not use fetchpatch or fetchFromGitHub to keep this package available in __bootPackages + src = fetchurl { + url = "https://github.com/stedolan/jq/releases/download/jq-${version}/jq-${version}.tar.gz"; + sha256 = "sha256-XejI4pqqP7nMa0e7JymfJxNU67clFOOsytx9OLW7qnI="; }; patches = [ - (fetchpatch { - name = "fix-tests-when-building-without-regex-supports.patch"; - url = "https://github.com/stedolan/jq/pull/2292/commits/f6a69a6e52b68a92b816a28eb20719a3d0cb51ae.patch"; - sha256 = "pTM5FZ6hFs5Rdx+W2dICSS2lcoLY1Q//Lan3Hu8Gr58="; - }) + ./fix-tests-when-building-without-regex-supports.patch ]; outputs = [ "bin" "doc" "man" "dev" "lib" "out" ]; @@ -69,7 +63,7 @@ stdenv.mkDerivation rec { description = "A lightweight and flexible command-line JSON processor"; homepage = "https://stedolan.github.io/jq/"; license = licenses.mit; - maintainers = with maintainers; [ raskin globin ]; + maintainers = with maintainers; [ raskin globin artturin ]; platforms = platforms.unix; downloadPage = "https://stedolan.github.io/jq/download/"; }; diff --git a/pkgs/development/tools/jq/fix-tests-when-building-without-regex-supports.patch b/pkgs/development/tools/jq/fix-tests-when-building-without-regex-supports.patch new file mode 100644 index 000000000000..ac7614ed80b2 --- /dev/null +++ b/pkgs/development/tools/jq/fix-tests-when-building-without-regex-supports.patch @@ -0,0 +1,38 @@ +From f6a69a6e52b68a92b816a28eb20719a3d0cb51ae Mon Sep 17 00:00:00 2001 +From: Dmitry Bogatov +Date: Sat, 27 Mar 2021 00:00:00 +0000 +Subject: [PATCH] Disable some tests when building without regex support + +--- + Makefile.am | 5 ++++- + configure.ac | 1 + + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index f5c1db594..f3f44bb9e 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -130,7 +130,10 @@ endif + + ### Tests (make check) + +-TESTS = tests/optionaltest tests/mantest tests/jqtest tests/onigtest tests/shtest tests/utf8test tests/base64test ++TESTS = tests/optionaltest tests/jqtest tests/shtest tests/utf8test tests/base64test ++if WITH_ONIGURUMA ++TESTS += tests/mantest tests/onigtest ++endif + TESTS_ENVIRONMENT = NO_VALGRIND=$(NO_VALGRIND) + + # This is a magic make variable that causes it to treat tests/man.test as a +diff --git a/configure.ac b/configure.ac +index 0441d4a2c..987d94e0a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -278,6 +278,7 @@ AC_SUBST(onig_CFLAGS) + AC_SUBST(onig_LDFLAGS) + + AM_CONDITIONAL([BUILD_ONIGURUMA], [test "x$build_oniguruma" = xyes]) ++AM_CONDITIONAL([WITH_ONIGURUMA], [test "x$with_oniguruma" = xyes]) + AC_SUBST([BUNDLER], ["$bundle_cmd"]) + + AC_CONFIG_MACRO_DIR([config/m4]) diff --git a/pkgs/development/tools/language-servers/ansible-language-server/default.nix b/pkgs/development/tools/language-servers/ansible-language-server/default.nix index 084e2e023d92..5b0ba5bfca20 100644 --- a/pkgs/development/tools/language-servers/ansible-language-server/default.nix +++ b/pkgs/development/tools/language-servers/ansible-language-server/default.nix @@ -18,7 +18,7 @@ buildNpmPackage rec { npmDepsHash = "sha256-rJ1O2OsrJhTIfywK9/MRubwwcCmMbu61T4zyayg+mAU="; npmBuildScript = "compile"; - # We remove the prepare and prepack scripts because they run the + # We remove/ignore the prepare and prepack scripts because they run the # build script, and therefore are redundant. # # Additionally, the prepack script runs npm ci in addition to the @@ -30,6 +30,7 @@ buildNpmPackage rec { sed -i '/"prepack"/d' package.json ''; + npmPackFlags = [ "--ignore-scripts" ]; passthru.updateScript = nix-update-script { }; meta = with lib; { diff --git a/pkgs/development/tools/misc/automake/builder.sh b/pkgs/development/tools/misc/automake/builder.sh index e54a2acca67e..0cb1d5d61e33 100644 --- a/pkgs/development/tools/misc/automake/builder.sh +++ b/pkgs/development/tools/misc/automake/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup # Wrap the given `aclocal' program, appending extra `-I' flags diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 4486636a9f50..53b02cc16ea8 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, targetPackages # Build time -, fetchurl, pkg-config, perl, texinfo, setupDebugInfoDirs, buildPackages +, fetchurl, fetchpatch, pkg-config, perl, texinfo, setupDebugInfoDirs, buildPackages # Run time , ncurses, readline, gmp, mpfr, expat, libipt, zlib, dejagnu, sourceHighlight @@ -47,6 +47,12 @@ stdenv.mkDerivation rec { patches = [ ./debug-info-from-env.patch + # backport readline=8.2 support + (fetchpatch { + name = "readline-8.2.patch"; + url = "https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=1add37b567a7dee39d99f37b37802034c3fce9c4"; + hash = "sha256-KmQXylPAWNGXF8wtXCCArhUzHi+GUY8ii2Xpx8R08jE="; + }) ] ++ lib.optionals stdenv.isDarwin [ ./darwin-target-match.patch # Does not nave to be conditional. We apply it conditionally diff --git a/pkgs/development/tools/misc/lit/default.nix b/pkgs/development/tools/misc/lit/default.nix index aa991e8ea978..5a255df46806 100644 --- a/pkgs/development/tools/misc/lit/default.nix +++ b/pkgs/development/tools/misc/lit/default.nix @@ -2,11 +2,11 @@ python3.pkgs.buildPythonApplication rec { pname = "lit"; - version = "14.0.0"; + version = "15.0.6"; src = python3.pkgs.fetchPypi { inherit pname version; - sha256 = "45e08ce87b0ea56ab632aa02fa857418a5dd241a711c7c756878b73a130c3efe"; + hash = "sha256-S06OQfDmDyutls21HxyQ016ku3FTTsDOP8Di67d9f+k="; }; passthru = { @@ -14,6 +14,9 @@ python3.pkgs.buildPythonApplication rec { }; # Non-standard test suite. Needs custom checkPhase. + # Needs LLVM's `FileCheck` and `not`: `$out/bin/lit tests` + # There should be `llvmPackages.lit` since older LLVM versions may + # have the possibility of not correctly interfacing with newer lit versions doCheck = false; meta = { diff --git a/pkgs/development/tools/parsing/antlr/builder.sh b/pkgs/development/tools/parsing/antlr/builder.sh index b8e7791b6fc9..55259b932124 100644 --- a/pkgs/development/tools/parsing/antlr/builder.sh +++ b/pkgs/development/tools/parsing/antlr/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup tar zxvf $src diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix b/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix index 9979153842b1..36a66d091aeb 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix @@ -1669,7 +1669,6 @@ lib.composeManyExtensions [ propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.cairo - pkgs.xlibsWrapper ]; mesonFlags = [ "-Dpython=${if self.isPy3k then "python3" else "python"}" ]; diff --git a/pkgs/development/tools/rocminfo/default.nix b/pkgs/development/tools/rocminfo/default.nix index 34dcb52526bd..64368fa0c95a 100644 --- a/pkgs/development/tools/rocminfo/default.nix +++ b/pkgs/development/tools/rocminfo/default.nix @@ -1,13 +1,12 @@ -{ stdenv -, lib +{ lib +, stdenv , fetchFromGitHub , rocmUpdateScript -, fetchpatch , cmake -, rocm-runtime -, python3 , rocm-cmake +, rocm-runtime , busybox +, python3 , gnugrep # rocminfo requires that the calling user have a password and be in # the video group. If we let rocm_agent_enumerator rely upon @@ -19,7 +18,7 @@ }: stdenv.mkDerivation (finalAttrs: { - version = "5.4.0"; + version = "5.4.1"; pname = "rocminfo"; src = fetchFromGitHub { @@ -29,25 +28,21 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-4wZTm5AZgG8xEd6uYqxWq4bWZgcSYZ2WYA1z4RAPF8U="; }; - enableParallelBuilding = true; - nativeBuildInputs = [ cmake ]; - buildInputs = [ rocm-cmake rocm-runtime ]; - - cmakeFlags = [ - "-DROCM_DIR=${rocm-runtime}" - "-DROCRTST_BLD_TYPE=Release" + nativeBuildInputs = [ + cmake + rocm-cmake ]; + buildInputs = [ rocm-runtime ]; + propagatedBuildInputs = [ python3 ]; + cmakeFlags = [ "-DROCRTST_BLD_TYPE=Release" ]; + prePatch = '' - sed 's,#!/usr/bin/env python3,#!${python3}/bin/python,' -i rocm_agent_enumerator + patchShebangs rocm_agent_enumerator sed 's,lsmod | grep ,${busybox}/bin/lsmod | ${gnugrep}/bin/grep ,' -i rocminfo.cc ''; - installPhase = '' - mkdir -p $out/bin - cp rocminfo $out/bin - cp rocm_agent_enumerator $out/bin - '' + lib.optionalString (defaultTargets != []) '' + postInstall = lib.optionalString (defaultTargets != [ ]) '' echo '${lib.concatStringsSep "\n" defaultTargets}' > $out/bin/target.lst ''; @@ -63,6 +58,6 @@ stdenv.mkDerivation (finalAttrs: { license = licenses.ncsa; maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; platforms = platforms.linux; - broken = stdenv.isAarch64; + broken = stdenv.isAarch64 || finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/development/tools/rust/cargo-auditable/cargo-wrapper.nix b/pkgs/development/tools/rust/cargo-auditable/cargo-wrapper.nix new file mode 100644 index 000000000000..3afa59739a37 --- /dev/null +++ b/pkgs/development/tools/rust/cargo-auditable/cargo-wrapper.nix @@ -0,0 +1,13 @@ +{ lib, writeShellApplication, cargo, cargo-auditable }: + +(writeShellApplication { + name = "cargo"; + runtimeInputs = [ cargo cargo-auditable ]; + text = '' + CARGO_AUDITABLE_IGNORE_UNSUPPORTED=1 cargo auditable "$@" + ''; +}) // { + meta = cargo-auditable.meta // { + mainProgram = "cargo"; + }; +} diff --git a/pkgs/development/tools/rust/cargo-auditable/default.nix b/pkgs/development/tools/rust/cargo-auditable/default.nix index 64580d8ad8b3..1c621276021a 100644 --- a/pkgs/development/tools/rust/cargo-auditable/default.nix +++ b/pkgs/development/tools/rust/cargo-auditable/default.nix @@ -1,23 +1,40 @@ -{ lib, rustPlatform, fetchFromGitHub }: +{ lib, fetchFromGitHub, makeRustPlatform, rustc, cargo }: -rustPlatform.buildRustPackage rec { - pname = "cargo-auditable"; - version = "0.5.5"; +let + args = rec { + pname = "cargo-auditable"; + version = "0.6.0"; - src = fetchFromGitHub { - owner = "rust-secure-code"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-mEmTgd7sC2jmYeb5pEO985v/aWWKlq/mSQUAGi32loY="; + src = fetchFromGitHub { + owner = "rust-secure-code"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-mSiEC+9QtRjWmywJnGgUqp+q8fhY0qUYrgjrAVaY114="; + }; + + cargoSha256 = "sha256-Wz5My/QxPpZVsPBUe3KHT3ttD6CTU8NCY8rhFEC+UlA="; + + meta = with lib; { + description = "A tool to make production Rust binaries auditable"; + homepage = "https://github.com/rust-secure-code/cargo-auditable"; + changelog = "https://github.com/rust-secure-code/cargo-auditable/blob/v${version}/cargo-auditable/CHANGELOG.md"; + license = with licenses; [ mit /* or */ asl20 ]; + maintainers = with maintainers; [ figsoda ]; + }; }; - cargoSha256 = "sha256-G72UUqvFaTY/GQSkpz1wIzjb7vIWuAjvKMZosUB6YsA="; - - meta = with lib; { - description = "A tool to make production Rust binaries auditable"; - homepage = "https://github.com/rust-secure-code/cargo-auditable"; - changelog = "https://github.com/rust-secure-code/cargo-auditable/blob/v${version}/cargo-auditable/CHANGELOG.md"; - license = with licenses; [ mit /* or */ asl20 ]; - maintainers = with maintainers; [ figsoda ]; + rustPlatform = makeRustPlatform { + inherit rustc; + cargo = cargo.override { + auditable = false; + }; }; -} + + bootstrap = rustPlatform.buildRustPackage (args // { + auditable = false; + }); +in + +rustPlatform.buildRustPackage.override { cargo-auditable = bootstrap; } (args // { + auditable = true; # TODO: remove when this is the default +}) diff --git a/pkgs/development/tools/rust/maturin/default.nix b/pkgs/development/tools/rust/maturin/default.nix index b276a618110f..384030c903d9 100644 --- a/pkgs/development/tools/rust/maturin/default.nix +++ b/pkgs/development/tools/rust/maturin/default.nix @@ -11,16 +11,16 @@ rustPlatform.buildRustPackage rec { pname = "maturin"; - version = "0.13.0"; + version = "0.14.5"; src = fetchFromGitHub { owner = "PyO3"; repo = "maturin"; rev = "v${version}"; - hash = "sha256-uKpYI+Oc49xgoIZCh72baBMZLcpMXk7g2Jb1DQxW9lk="; + hash = "sha256-3TEEmraQ9KGx29ok7IUdVzTW0ilaAci1dOZUlKvQYJE="; }; - cargoHash = "sha256-levBWghFIXOXe+NGXvwBqQpPmWeUK53ruSyLik1urSU="; + cargoHash = "sha256-/biWBTNIysg6HDozyF8UdKoxlgkHl9tnyean8+333hI="; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/development/tools/rust/rust-analyzer/default.nix b/pkgs/development/tools/rust/rust-analyzer/default.nix index ed83b670a928..5e09f36dce9b 100644 --- a/pkgs/development/tools/rust/rust-analyzer/default.nix +++ b/pkgs/development/tools/rust/rust-analyzer/default.nix @@ -22,6 +22,8 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256-N07+rUVtNm9/ZSCR6IS2nymDaPNW4+Ta5s3ZSHg9Mrk="; }; + auditable = true; # TODO: remove when this is the default + cargoBuildFlags = [ "--bin" "rust-analyzer" "--bin" "rust-analyzer-proc-macro-srv" ]; cargoTestFlags = [ "--package" "rust-analyzer" "--package" "proc-macro-srv-cli" ]; diff --git a/pkgs/development/tools/spirv-tools/default.nix b/pkgs/development/tools/spirv-tools/default.nix index 7edba948586e..6f95ded63e15 100644 --- a/pkgs/development/tools/spirv-tools/default.nix +++ b/pkgs/development/tools/spirv-tools/default.nix @@ -2,14 +2,14 @@ stdenv.mkDerivation rec { pname = "spirv-tools"; - version = "1.3.231.0"; + version = "1.3.236.0"; src = (assert version == spirv-headers.version; fetchFromGitHub { owner = "KhronosGroup"; repo = "SPIRV-Tools"; rev = "sdk-${version}"; - hash = "sha256-sqjQoz9v9alSPc0ujEcWZxDAWh2S6oAPP1+JZmNCpA0="; + hash = "sha256-BV7V/jS782zdvtuw/wNY5fyAdx8Z2niWSocNaW0Atho="; } ); diff --git a/pkgs/development/tools/vulkan-validation-layers/default.nix b/pkgs/development/tools/vulkan-validation-layers/default.nix index 4f6a766e5e96..17e898301956 100644 --- a/pkgs/development/tools/vulkan-validation-layers/default.nix +++ b/pkgs/development/tools/vulkan-validation-layers/default.nix @@ -22,7 +22,7 @@ let in stdenv.mkDerivation rec { pname = "vulkan-validation-layers"; - version = "1.3.231.0"; + version = "1.3.236.0"; # If we were to use "dev" here instead of headers, the setupHook would be # placed in that output instead of "out". @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { owner = "KhronosGroup"; repo = "Vulkan-ValidationLayers"; rev = "sdk-${version}"; - hash = "sha256-5bzUauu8081zyRaWmRUtOxHjUU4gc1GWoJtU783Msh0="; + hash = "sha256-+VbiXtxzYaF5o+wIrJ+09LmgBdaLv/0VJGFDnBkrXms="; }); # Include absolute paths to layer libraries in their associated diff --git a/pkgs/development/web/nodejs/npm-patches.nix b/pkgs/development/web/nodejs/npm-patches.nix new file mode 100644 index 000000000000..28432f806dc6 --- /dev/null +++ b/pkgs/development/web/nodejs/npm-patches.nix @@ -0,0 +1,23 @@ +{ fetchpatch }: + +[ + # Makes `npm pack` obey `--foreground-scripts` + (fetchpatch { + name = "libnpmpack-obey-foreground-scripts.patch"; + url = "https://github.com/npm/cli/commit/e4e8ae20aef9e27e57282e87e8757d5b364abb39.patch"; + hash = "sha256-NQ8CZBfRqAOMe0Ysg3cq1FiferWKTzXC1QXgzX+f8OU="; + stripLen = 2; + extraPrefix = "deps/npm/node_modules/"; + includes = [ "deps/npm/node_modules/libnpmpack/lib/index.js" ]; + }) + + # Makes `npm pack` obey `--ignore-scripts` + (fetchpatch { + name = "libnpmpack-obey-ignore-scripts.patch"; + url = "https://github.com/npm/cli/commit/a990c3c9a0e67f0a8b6454213675e159fe49432d.patch"; + hash = "sha256-eA5YST9RxMMjk5FCwEbl1HQUpXZuwWZkx5WC4yJium8="; + stripLen = 2; + extraPrefix = "deps/npm/node_modules/"; + includes = [ "deps/npm/node_modules/libnpmpack/lib/index.js" ]; + }) +] diff --git a/pkgs/development/web/nodejs/v16.nix b/pkgs/development/web/nodejs/v16.nix index a35c347c3d14..8483e7251b4e 100644 --- a/pkgs/development/web/nodejs/v16.nix +++ b/pkgs/development/web/nodejs/v16.nix @@ -5,6 +5,8 @@ let inherit openssl; python = python3; }; + + npmPatches = callPackage ./npm-patches.nix { }; in buildNodejs { inherit enableNpm; @@ -13,5 +15,5 @@ in patches = [ ./disable-darwin-v8-system-instrumentation.patch ./bypass-darwin-xcrun-node16.patch - ]; + ] ++ npmPatches; } diff --git a/pkgs/development/web/nodejs/v18.nix b/pkgs/development/web/nodejs/v18.nix index 29f133a81105..b91f2c9f2c2b 100644 --- a/pkgs/development/web/nodejs/v18.nix +++ b/pkgs/development/web/nodejs/v18.nix @@ -5,6 +5,8 @@ let inherit openssl; python = python3; }; + + npmPatches = callPackage ./npm-patches.nix { }; in buildNodejs { inherit enableNpm; @@ -21,5 +23,5 @@ buildNodejs { ./disable-darwin-v8-system-instrumentation.patch ./bypass-darwin-xcrun-node16.patch - ]; + ] ++ npmPatches; } diff --git a/pkgs/development/web/nodejs/v19.nix b/pkgs/development/web/nodejs/v19.nix index cbed3bbef9aa..335477aa7ddc 100644 --- a/pkgs/development/web/nodejs/v19.nix +++ b/pkgs/development/web/nodejs/v19.nix @@ -5,6 +5,8 @@ let inherit openssl; python = python3; }; + + npmPatches = callPackage ./npm-patches.nix { }; in buildNodejs { inherit enableNpm; @@ -14,5 +16,5 @@ buildNodejs { ./revert-arm64-pointer-auth.patch ./disable-darwin-v8-system-instrumentation-node19.patch ./bypass-darwin-xcrun-node16.patch - ]; + ] ++ npmPatches; } diff --git a/pkgs/games/jumpy/default.nix b/pkgs/games/jumpy/default.nix index 6d05cc48270f..e41e33b4003c 100644 --- a/pkgs/games/jumpy/default.nix +++ b/pkgs/games/jumpy/default.nix @@ -26,6 +26,8 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-cK5n75T+Kkd6F4q4MFZNn0R6W6Nk2/H23AGhIe2FCig="; + auditable = true; # TODO: remove when this is the default + nativeBuildInputs = [ makeWrapper ] ++ lib.optionals stdenv.isLinux [ diff --git a/pkgs/games/xskat/default.nix b/pkgs/games/xskat/default.nix index f8c5f539f7d2..74c2be586ceb 100644 --- a/pkgs/games/xskat/default.nix +++ b/pkgs/games/xskat/default.nix @@ -26,7 +26,5 @@ stdenv.mkDerivation rec { license = licenses.free; longDescription = "Play the german card game Skat against the AI or over IRC."; homepage = "http://www.xskat.de/"; - # never built on aarch64-darwin since first introduction in nixpkgs - broken = stdenv.isDarwin && stdenv.isAarch64; }; } diff --git a/pkgs/games/xsok/default.nix b/pkgs/games/xsok/default.nix index 80de216e8639..bb749b57d01e 100644 --- a/pkgs/games/xsok/default.nix +++ b/pkgs/games/xsok/default.nix @@ -42,7 +42,5 @@ stdenv.mkDerivation rec { maintainers = [lib.maintainers.raskin]; platforms = lib.platforms.unix; homepage = "https://tracker.debian.org/pkg/xsok"; - # never built on aarch64-darwin since first introduction in nixpkgs - broken = stdenv.isDarwin && stdenv.isAarch64; }; } diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix index 30e0ce44ca4a..b707647377ca 100644 --- a/pkgs/misc/cups/default.nix +++ b/pkgs/misc/cups/default.nix @@ -38,6 +38,11 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace cups/testfile.c \ --replace 'cupsFileFind("cat", "/bin' 'cupsFileFind("cat", "${coreutils}/bin' + + # The cups.socket unit shouldn't be part of cups.service: stopping the + # service would stop the socket and break subsequent socket activations. + # See https://github.com/apple/cups/issues/6005 + sed -i '/PartOf=cups.service/d' scheduler/cups.socket.in ''; nativeBuildInputs = [ pkg-config removeReferencesTo ]; diff --git a/pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh b/pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh index f750df6e5063..bdb522744182 100644 --- a/pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh +++ b/pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup arch=$(uname -m) diff --git a/pkgs/os-specific/darwin/signing-utils/auto-sign-hook.sh b/pkgs/os-specific/darwin/signing-utils/auto-sign-hook.sh index cca65661f8a9..6a254cd82123 100644 --- a/pkgs/os-specific/darwin/signing-utils/auto-sign-hook.sh +++ b/pkgs/os-specific/darwin/signing-utils/auto-sign-hook.sh @@ -25,7 +25,7 @@ signDarwinBinariesIn() { signDarwinBinariesInAllOutputs() { local output - for output in $outputs; do + for output in $(getAllOutputNames); do signDarwinBinariesIn "${!output}" done } diff --git a/pkgs/os-specific/linux/ell/default.nix b/pkgs/os-specific/linux/ell/default.nix index 1e188fbe6074..3306d875272f 100644 --- a/pkgs/os-specific/linux/ell/default.nix +++ b/pkgs/os-specific/linux/ell/default.nix @@ -7,14 +7,14 @@ stdenv.mkDerivation rec { pname = "ell"; - version = "0.54"; + version = "0.55"; outputs = [ "out" "dev" ]; src = fetchgit { url = "https://git.kernel.org/pub/scm/libs/ell/ell.git"; rev = version; - sha256 = "sha256-Oi+S4DWXuTUL36Xh3iWIZj9rdN2qUDHmZiFSH1csW+8="; + sha256 = "sha256-vMWs+0iaszq+p55Z9AhqkNHWeOwlgt2iq7uuA8xGjJ4="; }; nativeBuildInputs = [ diff --git a/pkgs/os-specific/linux/fxload/default.nix b/pkgs/os-specific/linux/fxload/default.nix index 8c1a778ec8bf..3c5443f3432f 100644 --- a/pkgs/os-specific/linux/fxload/default.nix +++ b/pkgs/os-specific/linux/fxload/default.nix @@ -1,37 +1,31 @@ -{lib, stdenv, fetchurl}: +{ lib +, stdenv +, libusb1 +}: stdenv.mkDerivation rec { pname = "fxload"; - version = "2002.04.11"; + version = libusb1.version; + dontUnpack = true; + dontBuild = true; + dontConfigure = true; + dontInstall = true; + dontPatch = true; + dontPatchELF = true; - src = fetchurl { - url = "mirror://sourceforge/linux-hotplug/fxload-${lib.replaceStrings ["."] ["_"] version}.tar.gz"; - sha256 = "1hql93bp3dxrv1p67nc63xsbqwljyynm997ysldrc3n9ifi6s48m"; - }; - - patches = [ - # Will be needed after linux-headers is updated to >= 2.6.21. - (fetchurl { - url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/sys-apps/fxload/files/fxload-20020411-linux-headers-2.6.21.patch?rev=1.1"; - sha256 = "0ij0c8nr1rbyl5wmyv1cklhkxglvsqz32h21cjw4bjm151kgmk7p"; - }) - ]; - - preBuild = '' - substituteInPlace Makefile --replace /usr / - makeFlagsArray=(INSTALL=install prefix=$out) - ''; - - preInstall = '' + # fxload binary exist inside the `examples/bin` directory of `libusb1` + postFixup = '' mkdir -p $out/sbin - mkdir -p $out/share/man/man8 - mkdir -p $out/share/usb + ln -s ${passthru.libusb}/examples/bin/fxload $out/sbin/fxload ''; + passthru.libusb = libusb1.override { withExamples = true; }; + meta = with lib; { - homepage = "http://linux-hotplug.sourceforge.net/?selected=usb"; - description = "Tool to upload firmware to Cypress EZ-USB microcontrollers"; - license = licenses.gpl2; + homepage = "https://github.com/libusb/libusb"; + description = "Tool to upload firmware to into an21, fx, fx2, fx2lp and fx3 ez-usb devices"; + license = licenses.gpl2Only; platforms = platforms.linux; + maintainers = with maintainers; [ realsnick ]; }; } diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix index 89c191cb7f35..9a63a28a7a96 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.0.0"; + version = "6.1.0"; src = fetchurl { url = "mirror://kernel/linux/utils/net/${pname}/${pname}-${version}.tar.xz"; - sha256 = "UjE56ecq7JljdPot50vkxT0t0FWJSIk00h/5e64ZWAo="; + sha256 = "sha256-XOEqD+xrIScl7yGHNZQbLat2JE235yZGp2AhsFN7Q6s="; }; patches = [ diff --git a/pkgs/os-specific/linux/iwd/default.nix b/pkgs/os-specific/linux/iwd/default.nix index b3895c286c56..54a9a53a0367 100644 --- a/pkgs/os-specific/linux/iwd/default.nix +++ b/pkgs/os-specific/linux/iwd/default.nix @@ -12,12 +12,12 @@ stdenv.mkDerivation rec { pname = "iwd"; - version = "2.0"; + version = "2.1"; src = fetchgit { url = "https://git.kernel.org/pub/scm/network/wireless/iwd.git"; rev = version; - sha256 = "sha256-9eQ2fW3ha69ngugYonbYdqrpERqt8aM0Ed4HM0CrmUU="; + sha256 = "sha256-Aq038SG8vuxCA6mYOP5I6VWCUty5vgdbpAa9J+bIfZM="; }; outputs = [ "out" "man" "doc" ] diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index d8bfb59bf12a..34fbde9d676a 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -114,12 +114,12 @@ let in { inherit makeLinuxHeaders; - linuxHeaders = let version = "6.0"; in + linuxHeaders = let version = "6.1"; in makeLinuxHeaders { inherit version; src = fetchurl { url = "mirror://kernel/linux/kernel/v${lib.versions.major version}.x/linux-${version}.tar.xz"; - sha256 = "sha256-XCRDpVON5SaI77VcJ6sFOcH161jAz9FqK5+7CP2BeI4="; + sha256 = "sha256-LKHxcFGkMPb+0RluSVJxdQcXGs/ZfZZXchJQJwOyXes="; }; patches = [ ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms diff --git a/pkgs/os-specific/linux/libbpf/default.nix b/pkgs/os-specific/linux/libbpf/default.nix index 04322a35b4fe..d6bb9d4a431b 100644 --- a/pkgs/os-specific/linux/libbpf/default.nix +++ b/pkgs/os-specific/linux/libbpf/default.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation rec { pname = "libbpf"; - version = "1.0.1"; + version = "1.1.0"; src = fetchFromGitHub { owner = "libbpf"; repo = "libbpf"; rev = "v${version}"; - sha256 = "sha256-2rzVah+CxCztKnlEWMIQrUS2JJTLiWscfIA1aOBtIzs="; + sha256 = "sha256-/vt6IA1o0gjFtXUWhEKIZ1DUWIN2LOvrhLfFzJBACGY="; }; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/os-specific/linux/nvidia-x11/builder.sh b/pkgs/os-specific/linux/nvidia-x11/builder.sh index eadf88fd1168..1cf1400f996b 100755 --- a/pkgs/os-specific/linux/nvidia-x11/builder.sh +++ b/pkgs/os-specific/linux/nvidia-x11/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup unpackManually() { diff --git a/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh b/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh index cd21899e60e7..34f9b1579455 100644 --- a/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh +++ b/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup mkdir -p $out/lib diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix index c6fd417d0d6f..2d0e60716290 100644 --- a/pkgs/os-specific/linux/shadow/default.nix +++ b/pkgs/os-specific/linux/shadow/default.nix @@ -1,57 +1,62 @@ -{ lib, stdenv, nixosTests, fetchpatch, fetchFromGitHub, autoreconfHook, libxslt -, libxml2 , docbook_xml_dtd_45, docbook_xsl, itstool, flex, bison, runtimeShell -, libxcrypt, pam ? null, glibcCross ? null +{ lib, stdenv, fetchFromGitHub +, runtimeShell, nixosTests, fetchpatch +, autoreconfHook, bison, flex +, docbook_xml_dtd_45, docbook_xsl +, itstool , libxml2, libxslt +, libxcrypt +, glibcCross ? null +, pam ? null +, withTcb ? stdenv.isLinux, tcb }: - let - glibc = - if stdenv.hostPlatform != stdenv.buildPlatform - then glibcCross + if stdenv.hostPlatform != stdenv.buildPlatform then glibcCross else assert stdenv.hostPlatform.libc == "glibc"; stdenv.cc.libc; - dots_in_usernames = fetchpatch { - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch"; - sha256 = "1fj3rg6x3jppm5jvi9y7fhd2djbi4nc5pgwisw00xlh4qapgz692"; - }; - in stdenv.mkDerivation rec { pname = "shadow"; - version = "4.11.1"; + version = "4.13"; src = fetchFromGitHub { owner = "shadow-maint"; - repo = "shadow"; - rev = "v${version}"; - sha256 = "sha256-PxLX5V0t18JftT5wT41krNv18Ew7Kz3MfZkOi/80ODA="; + repo = pname; + rev = version; + sha256 = "sha256-L54DhdBYthfB9436t/XWXiqKhW7rfd0GLS7pYGB32rA="; }; - buildInputs = [ libxcrypt ] - ++ lib.optional (pam != null && stdenv.isLinux) pam; - nativeBuildInputs = [autoreconfHook libxslt libxml2 - docbook_xml_dtd_45 docbook_xsl flex bison itstool - ]; - - patches = - [ ./keep-path.patch - # Obtain XML resources from XML catalog (patch adapted from gtk-doc) - ./respect-xml-catalog-files-var.patch - dots_in_usernames - ./runtime-shell.patch - ]; + outputs = [ "out" "su" "dev" "man" ]; RUNTIME_SHELL = runtimeShell; + nativeBuildInputs = [ + autoreconfHook bison flex + docbook_xml_dtd_45 docbook_xsl + itstool libxml2 libxslt + ]; + + buildInputs = [ libxcrypt ] + ++ lib.optional (pam != null && stdenv.isLinux) pam + ++ lib.optional withTcb tcb; + + patches = [ + ./keep-path.patch + # Obtain XML resources from XML catalog (patch adapted from gtk-doc) + ./respect-xml-catalog-files-var.patch + ./runtime-shell.patch + ./fix-install-with-tcb.patch + # Fix HAVE_SHADOWGRP configure check + (fetchpatch { + url = "https://github.com/shadow-maint/shadow/commit/a281f241b592aec636d1b93a99e764499d68c7ef.patch"; + sha256 = "sha256-GJWg/8ggTnrbIgjI+HYa26DdVbjTHTk/IHhy7GU9G5w="; + }) + ]; + # The nix daemon often forbids even creating set[ug]id files. - postPatch = - ''sed 's/^\(s[ug]idperms\) = [0-9]755/\1 = 0755/' -i src/Makefile.am - ''; - - outputs = [ "out" "su" "man" ]; - - enableParallelBuilding = true; + postPatch = '' + sed 's/^\(s[ug]idperms\) = [0-9]755/\1 = 0755/' -i src/Makefile.am + ''; # Assume System V `setpgrp (void)', which is the default on GNU variants # (`AC_FUNC_SETPGRP' is not cross-compilation capable.) @@ -65,23 +70,24 @@ stdenv.mkDerivation rec { "--with-group-name-max-length=32" "--with-bcrypt" "--with-yescrypt" - ] ++ lib.optional (stdenv.hostPlatform.libc != "glibc") "--disable-nscd"; + ] ++ lib.optional (stdenv.hostPlatform.libc != "glibc") "--disable-nscd" + ++ lib.optional withTcb "--with-tcb"; - preBuild = lib.optionalString (stdenv.hostPlatform.libc == "glibc") - '' - substituteInPlace lib/nscd.c --replace /usr/sbin/nscd ${glibc.bin}/bin/nscd - ''; + preBuild = lib.optionalString (stdenv.hostPlatform.libc == "glibc") '' + substituteInPlace lib/nscd.c --replace /usr/sbin/nscd ${glibc.bin}/bin/nscd + ''; - postInstall = - '' - # Don't install ‘groups’, since coreutils already provides it. - rm $out/bin/groups - rm $man/share/man/man1/groups.* + postInstall = '' + # Don't install ‘groups’, since coreutils already provides it. + rm $out/bin/groups + rm $man/share/man/man1/groups.* - # Move the su binary into the su package - mkdir -p $su/bin - mv $out/bin/su $su/bin - ''; + # Move the su binary into the su package + mkdir -p $su/bin + mv $out/bin/su $su/bin + ''; + + enableParallelBuilding = true; disallowedReferences = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.shellPackage; diff --git a/pkgs/os-specific/linux/shadow/fix-install-with-tcb.patch b/pkgs/os-specific/linux/shadow/fix-install-with-tcb.patch new file mode 100644 index 000000000000..ff6166b92f1d --- /dev/null +++ b/pkgs/os-specific/linux/shadow/fix-install-with-tcb.patch @@ -0,0 +1,28 @@ +diff --git a/src/Makefile.am b/src/Makefile.am +index a1a2e4e..fa17f9d 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -74,10 +74,6 @@ suidubins += newgidmap newuidmap + endif + endif + +-if WITH_TCB +-shadowsgidubins = passwd +-endif +- + LDADD = $(INTLLIBS) \ + $(top_builddir)/libmisc/libmisc.la \ + $(top_builddir)/lib/libshadow.la \ +@@ -146,12 +142,6 @@ install-am: all-am + set -e; for i in $(suidusbins); do \ + chmod $(suidperms) $(DESTDIR)$(usbindir)/$$i; \ + done +-if WITH_TCB +- set -e; for i in $(shadowsgidubins); do \ +- chown root:shadow $(DESTDIR)$(ubindir)/$$i; \ +- chmod $(sgidperms) $(DESTDIR)$(ubindir)/$$i; \ +- done +-endif + if ENABLE_SUBIDS + if FCAPS + setcap cap_setuid+ep $(DESTDIR)$(ubindir)/newuidmap diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 4e3f3762370d..4c16e96fdb10 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -89,7 +89,7 @@ , withDocumentation ? true , withEfi ? stdenv.hostPlatform.isEfi && !stdenv.hostPlatform.isMusl , withFido2 ? true -, withHomed ? false +, withHomed ? true , withHostnamed ? true , withHwdb ? true , withImportd ? !stdenv.hostPlatform.isMusl @@ -130,7 +130,7 @@ assert withHomed -> withCryptsetup; let wantCurl = withRemote || withImportd; wantGcrypt = withResolved || withImportd; - version = "252.1"; + version = "252.4"; # Bump this variable on every (major) version change. See below (in the meson options list) for why. # command: @@ -147,7 +147,7 @@ stdenv.mkDerivation { owner = "systemd"; repo = "systemd-stable"; rev = "v${version}"; - hash = "sha256-G43qbNF7znTITSM78sOL0qi8nqaA7qIhmiqP/rZKjXY="; + hash = "sha256-8ejSEt3QyCSARGGVbXWac2dB9jdUpC4eX2rN0iENQX0="; }; # On major changes, or when otherwise required, you *must* reformat the patches, diff --git a/pkgs/servers/http/tomcat/axis2/builder.sh b/pkgs/servers/http/tomcat/axis2/builder.sh index 2e36367e9dcf..d334ab6f927f 100644 --- a/pkgs/servers/http/tomcat/axis2/builder.sh +++ b/pkgs/servers/http/tomcat/axis2/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup unzip $src diff --git a/pkgs/servers/monitoring/munin/default.nix b/pkgs/servers/monitoring/munin/default.nix index c05dbe28f249..ad2eb3691314 100644 --- a/pkgs/servers/monitoring/munin/default.nix +++ b/pkgs/servers/monitoring/munin/default.nix @@ -55,7 +55,7 @@ stdenv.mkDerivation rec { ]; # needs to find a local perl module during build - PERL_USE_UNSAFE_INC = "1"; + env.PERL_USE_UNSAFE_INC = "1"; # TODO: tests are failing https://munin-monitoring.org/ticket/1390#comment:1 # NOTE: important, test command always exits with 0, think of a way to abort the build once tests pass diff --git a/pkgs/servers/x11/xorg/builder.sh b/pkgs/servers/x11/xorg/builder.sh index 5a832cb14d53..9ee81091584b 100644 --- a/pkgs/servers/x11/xorg/builder.sh +++ b/pkgs/servers/x11/xorg/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi # This is the builder for all X.org components. source $stdenv/setup diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 59d66abf994b..ed9efb690fa8 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -38,7 +38,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - bitmap = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, xbitmaps, libXmu, xorgproto, libXt }: stdenv.mkDerivation { + bitmap = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, xbitmaps, libXmu, xorgproto, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "bitmap"; version = "1.0.9"; builder = ./builder.sh; @@ -48,13 +48,13 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libX11 libXaw xbitmaps libXmu xorgproto libXt ]; meta.platforms = lib.platforms.unix; }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - editres = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, xorgproto, libXt }: stdenv.mkDerivation { + editres = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, xorgproto, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "editres"; version = "1.0.7"; builder = ./builder.sh; @@ -64,7 +64,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libX11 libXaw libXmu xorgproto libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -1578,7 +1578,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - oclock = callPackage ({ stdenv, pkg-config, fetchurl, libxkbfile, libX11, libXext, libXmu, libXt }: stdenv.mkDerivation { + oclock = callPackage ({ stdenv, pkg-config, fetchurl, libxkbfile, libX11, libXext, libXmu, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "oclock"; version = "1.0.4"; builder = ./builder.sh; @@ -1588,7 +1588,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libxkbfile libX11 libXext libXmu libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -1690,7 +1690,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - viewres = callPackage ({ stdenv, pkg-config, fetchurl, libXaw, libXmu, libXt }: stdenv.mkDerivation { + viewres = callPackage ({ stdenv, pkg-config, fetchurl, libXaw, libXmu, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "viewres"; version = "1.0.5"; builder = ./builder.sh; @@ -1700,7 +1700,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libXaw libXmu libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -1724,11 +1724,11 @@ self: with self; { # THIS IS A GENERATED FILE. DO NOT EDIT! xauth = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXau, libXext, libXmu, xorgproto }: stdenv.mkDerivation { pname = "xauth"; - version = "1.1"; + version = "1.1.2"; builder = ./builder.sh; src = fetchurl { - url = "mirror://xorg/individual/app/xauth-1.1.tar.bz2"; - sha256 = "032klzzw8r09z36x1272ssd79bcisz8j5p8gbdy111fiknvx27bd"; + url = "mirror://xorg/individual/app/xauth-1.1.2.tar.xz"; + sha256 = "0072ivzn4z59ysanz838nh8s4mcmdsx6q9xkvlfysv2k37ynmfkq"; }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; @@ -1770,7 +1770,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xcalc = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, xorgproto, libXt }: stdenv.mkDerivation { + xcalc = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, xorgproto, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xcalc"; version = "1.1.0"; builder = ./builder.sh; @@ -1780,7 +1780,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libX11 libXaw xorgproto libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -1914,7 +1914,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xclock = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXft, libxkbfile, libXmu, xorgproto, libXrender, libXt }: stdenv.mkDerivation { + xclock = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXft, libxkbfile, libXmu, xorgproto, libXrender, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xclock"; version = "1.0.9"; builder = ./builder.sh; @@ -1924,7 +1924,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libX11 libXaw libXft libxkbfile libXmu xorgproto libXrender libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -1962,7 +1962,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xconsole = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, xorgproto, libXt }: stdenv.mkDerivation { + xconsole = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, xorgproto, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xconsole"; version = "1.0.7"; builder = ./builder.sh; @@ -1972,7 +1972,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libX11 libXaw libXmu xorgproto libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -2010,7 +2010,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xdm = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXau, libXaw, libXdmcp, libXext, libXft, libXinerama, libXmu, libXpm, xorgproto, libXrender, libXt }: stdenv.mkDerivation { + xdm = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXau, libXaw, libXdmcp, libXext, libXft, libXinerama, libXmu, libXpm, xorgproto, libXrender, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xdm"; version = "1.1.12"; builder = ./builder.sh; @@ -2020,7 +2020,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libX11 libXau libXaw libXdmcp libXext libXft libXinerama libXmu libXpm xorgproto libXrender libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -2460,11 +2460,11 @@ self: with self; { # THIS IS A GENERATED FILE. DO NOT EDIT! xf86videomga = callPackage ({ stdenv, pkg-config, fetchurl, xorgproto, libdrm, libpciaccess, xorgserver }: stdenv.mkDerivation { pname = "xf86-video-mga"; - version = "2.0.0"; + version = "2.0.1"; builder = ./builder.sh; src = fetchurl { - url = "mirror://xorg/individual/driver/xf86-video-mga-2.0.0.tar.bz2"; - sha256 = "0yaxpgyyj9398nzzr5vnsfxcis76z46p9814yzj8179yl7hld296"; + url = "mirror://xorg/individual/driver/xf86-video-mga-2.0.1.tar.xz"; + sha256 = "1aq3aqh2yg09gy864kkshfx5pjl5w05jdz97bx5bnrbrhdq3p8r7"; }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; @@ -2588,11 +2588,11 @@ self: with self; { # THIS IS A GENERATED FILE. DO NOT EDIT! xf86videor128 = callPackage ({ stdenv, pkg-config, fetchurl, xorgproto, libdrm, libpciaccess, xorgserver }: stdenv.mkDerivation { pname = "xf86-video-r128"; - version = "6.11.0"; + version = "6.12.1"; builder = ./builder.sh; src = fetchurl { - url = "mirror://xorg/individual/driver/xf86-video-r128-6.11.0.tar.bz2"; - sha256 = "0snvwmrh8dqyyaq7ggicym6yrsg4brygkx9156r0m095m7fp3rav"; + url = "mirror://xorg/individual/driver/xf86-video-r128-6.12.1.tar.xz"; + sha256 = "0hf7h54wxgs8njavp0kgadjq1787fhbd588j7pj685hz2wmkq0kx"; }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; @@ -2906,7 +2906,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xfd = callPackage ({ stdenv, pkg-config, fetchurl, libxkbfile, fontconfig, libXaw, libXft, libXmu, xorgproto, libXrender, libXt, gettext }: stdenv.mkDerivation { + xfd = callPackage ({ stdenv, pkg-config, fetchurl, libxkbfile, fontconfig, libXaw, libXft, libXmu, xorgproto, libXrender, libXt, gettext, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xfd"; version = "1.1.3"; builder = ./builder.sh; @@ -2916,13 +2916,13 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config gettext ]; + nativeBuildInputs = [ pkg-config gettext wrapWithXFileSearchPathHook ]; buildInputs = [ libxkbfile fontconfig libXaw libXft libXmu xorgproto libXrender libXt ]; meta.platforms = lib.platforms.unix; }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xfontsel = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, libXt }: stdenv.mkDerivation { + xfontsel = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xfontsel"; version = "1.0.6"; builder = ./builder.sh; @@ -2932,7 +2932,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libX11 libXaw libXmu libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -2986,7 +2986,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xgc = callPackage ({ stdenv, pkg-config, fetchurl, libXaw, libXt }: stdenv.mkDerivation { + xgc = callPackage ({ stdenv, pkg-config, fetchurl, libXaw, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xgc"; version = "1.0.5"; builder = ./builder.sh; @@ -2996,7 +2996,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libXaw libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -3146,7 +3146,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xload = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, xorgproto, libXt, gettext }: stdenv.mkDerivation { + xload = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, xorgproto, libXt, gettext, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xload"; version = "1.1.3"; builder = ./builder.sh; @@ -3156,7 +3156,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config gettext ]; + nativeBuildInputs = [ pkg-config gettext wrapWithXFileSearchPathHook ]; buildInputs = [ libX11 libXaw libXmu xorgproto libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -3210,7 +3210,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xmag = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, libXt }: stdenv.mkDerivation { + xmag = callPackage ({ stdenv, pkg-config, fetchurl, libX11, libXaw, libXmu, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xmag"; version = "1.0.6"; builder = ./builder.sh; @@ -3220,13 +3220,13 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libX11 libXaw libXmu libXt ]; meta.platforms = lib.platforms.unix; }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xmessage = callPackage ({ stdenv, pkg-config, fetchurl, libXaw, libXt }: stdenv.mkDerivation { + xmessage = callPackage ({ stdenv, pkg-config, fetchurl, libXaw, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xmessage"; version = "1.0.5"; builder = ./builder.sh; @@ -3236,7 +3236,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libXaw libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -3258,7 +3258,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xmore = callPackage ({ stdenv, pkg-config, fetchurl, libXaw, libXt }: stdenv.mkDerivation { + xmore = callPackage ({ stdenv, pkg-config, fetchurl, libXaw, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xmore"; version = "1.0.3"; builder = ./builder.sh; @@ -3268,7 +3268,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libXaw libXt ]; meta.platforms = lib.platforms.unix; }) {}; @@ -3466,7 +3466,7 @@ self: with self; { }) {}; # THIS IS A GENERATED FILE. DO NOT EDIT! - xsm = callPackage ({ stdenv, pkg-config, fetchurl, libICE, libSM, libX11, libXaw, libXt }: stdenv.mkDerivation { + xsm = callPackage ({ stdenv, pkg-config, fetchurl, libICE, libSM, libX11, libXaw, libXt, wrapWithXFileSearchPathHook }: stdenv.mkDerivation { pname = "xsm"; version = "1.0.4"; builder = ./builder.sh; @@ -3476,7 +3476,7 @@ self: with self; { }; hardeningDisable = [ "bindnow" "relro" ]; strictDeps = true; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapWithXFileSearchPathHook ]; buildInputs = [ libICE libSM libX11 libXaw libXt ]; meta.platforms = lib.platforms.unix; }) {}; diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index 987895ab6e1d..a3751bf16f00 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -23,7 +23,7 @@ my %pcMap; my %extraAttrs; -my @missingPCs = ("fontconfig", "libdrm", "libXaw", "zlib", "perl", "python3", "mkfontscale", "bdftopcf", "libxslt", "openssl", "gperf", "m4", "libinput", "libevdev", "mtdev", "xorgproto", "cairo", "gettext", "meson", "ninja" ); +my @missingPCs = ("fontconfig", "libdrm", "libXaw", "zlib", "perl", "python3", "mkfontscale", "bdftopcf", "libxslt", "openssl", "gperf", "m4", "libinput", "libevdev", "mtdev", "xorgproto", "cairo", "gettext", "meson", "ninja", "wrapWithXFileSearchPathHook" ); $pcMap{$_} = $_ foreach @missingPCs; $pcMap{"freetype2"} = "freetype"; $pcMap{"libpng12"} = "libpng"; @@ -195,6 +195,10 @@ while (<>) { push @{$extraAttrs{$pkg}}, "postPatch = ''substituteInPlace configure --replace 'MAPFILES_PATH=`pkg-config' 'MAPFILES_PATH=`\$PKG_CONFIG' '';"; } + if (@@ = glob("$tmpDir/*/app-defaults/")) { + push @nativeRequires, "wrapWithXFileSearchPathHook"; + } + sub process { my $requires = shift; my $s = shift; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 8b3129f5ae21..6de759498b21 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -1,6 +1,7 @@ { abiCompat ? null, + callPackage, lib, stdenv, makeWrapper, fetchurl, fetchpatch, fetchFromGitLab, buildPackages, - automake, autoconf, gettext, libiconv, libtool, intltool, + automake, autoconf, libiconv, libtool, intltool, freetype, tradcpp, fontconfig, meson, ninja, ed, fontforge, libGL, spice-protocol, zlib, libGLU, dbus, libunwind, libdrm, mesa, udev, bootstrap_cmds, bison, flex, clangStdenv, autoreconfHook, @@ -22,25 +23,28 @@ let in self: super: { + wrapWithXFileSearchPathHook = callPackage ({ makeBinaryWrapper, makeSetupHook, writeScript }: makeSetupHook { + name = "wrapWithXFileSearchPathHook"; + deps = [ makeBinaryWrapper ]; + } (writeScript "wrapWithXFileSearchPathHook.sh" '' + wrapWithXFileSearchPath() { + paths=( + "$out/share/X11/%T/%N" + "$out/include/X11/%T/%N" + "${xorg.xbitmaps}/include/X11/%T/%N" + ) + for exe in $out/bin/*; do + wrapProgram "$exe" \ + --suffix XFILESEARCHPATH : $(IFS=:; echo "''${paths[*]}") + done + } + postInstallHooks+=(wrapWithXFileSearchPath) + '')) {}; + bdftopcf = super.bdftopcf.overrideAttrs (attrs: { buildInputs = attrs.buildInputs ++ [ xorg.xorgproto ]; }); - bitmap = super.bitmap.overrideAttrs (attrs: { - nativeBuildInputs = attrs.nativeBuildInputs ++ [ makeWrapper ]; - postInstall = '' - paths=( - "$out/share/X11/%T/%N" - "$out/include/X11/%T/%N" - "${xorg.xbitmaps}/include/X11/%T/%N" - ) - wrapProgram "$out/bin/bitmap" \ - --suffix XFILESEARCHPATH : $(IFS=:; echo "''${paths[*]}") - makeWrapper "$out/bin/bitmap" "$out/bin/bitmap-color" \ - --suffix XFILESEARCHPATH : "$out/share/X11/%T/%N-color" - ''; - }); - editres = super.editres.overrideAttrs (attrs: { hardeningDisable = [ "format" ]; }); @@ -140,6 +144,14 @@ self: super: configureFlags = attrs.configureFlags or [] ++ malloc0ReturnsNullCrossFlag; }); + libFS = super.libFS.overrideAttrs (attrs: { + configureFlags = attrs.configureFlags or [] + ++ malloc0ReturnsNullCrossFlag; + }); + libWindowsWM = super.libWindowsWM.overrideAttrs (attrs: { + configureFlags = attrs.configureFlags or [] + ++ malloc0ReturnsNullCrossFlag; + }); xdpyinfo = super.xdpyinfo.overrideAttrs (attrs: { configureFlags = attrs.configureFlags or [] ++ malloc0ReturnsNullCrossFlag; @@ -312,11 +324,6 @@ self: super: }); libxshmfence = super.libxshmfence.overrideAttrs (attrs: { - name = "libxshmfence-1.3"; - src = fetchurl { - url = "mirror://xorg/individual/lib/libxshmfence-1.3.tar.bz2"; - sha256 = "1ir0j92mnd1nk37mrv9bz5swnccqldicgszvfsh62jd14q6k115q"; - }; outputs = [ "out" "dev" ]; # mainly to avoid propagation }); @@ -705,10 +712,6 @@ self: super: postPatch = with lib; concatStrings (mapAttrsToList patchIn layouts); }); - xload = super.xload.overrideAttrs (attrs: { - nativeBuildInputs = attrs.nativeBuildInputs ++ [ gettext ]; - }); - xlsfonts = super.xlsfonts.overrideAttrs (attrs: { meta = attrs.meta // { license = lib.licenses.mit; }; }); @@ -1023,7 +1026,7 @@ self: super: rev = "31486f40f8e8f8923ca0799aea84b58799754564"; sha256 = "sha256-nqT9VZDb2kAC72ot9UCdwEkM1uuP9NriJePulzrdZlM="; }; - buildInputs = attrs.buildInputs ++ [ xorg.libXScrnSaver xorg.libXfixes xorg.libXv xorg.pixman xorg.utilmacros ]; + buildInputs = attrs.buildInputs ++ [ xorg.libXScrnSaver xorg.libXv xorg.pixman xorg.utilmacros ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [autoreconfHook ]; configureFlags = [ "--with-default-dri=3" "--enable-tools" ]; @@ -1066,6 +1069,13 @@ self: super: }); xorgcffiles = super.xorgcffiles.overrideAttrs (attrs: { + patches = [ + (fetchpatch { + name = "add-aarch64-darwin-support.patch"; + url = "https://gitlab.freedesktop.org/xorg/util/cf/-/commit/8d88c559b177e832b581c8ac0aa383b6cf79e0d0.patch"; + sha256 = "sha256-wCijdmlUtVgOh9Rp/LJrg1ObYm4OPTke5Xwu0xC0ap4="; + }) + ]; postInstall = lib.optionalString stdenv.isDarwin '' substituteInPlace $out/lib/X11/config/darwin.cf --replace "/usr/bin/" "" ''; @@ -1091,17 +1101,6 @@ self: super: ''; }); - xcalc = super.xcalc.overrideAttrs (attrs: { - configureFlags = attrs.configureFlags or [] ++ [ - "--with-appdefaultdir=${placeholder "out"}/share/X11/app-defaults" - ]; - nativeBuildInputs = attrs.nativeBuildInputs or [] ++ [ makeWrapper ]; - postInstall = '' - wrapProgram $out/bin/xcalc \ - --set XAPPLRESDIR ${placeholder "out"}/share/X11/app-defaults - ''; - }); - # convert Type1 vector fonts to OpenType fonts fontbitstreamtype1 = super.fontbitstreamtype1.overrideAttrs (attrs: { nativeBuildInputs = attrs.nativeBuildInputs ++ [ fontforge ]; diff --git a/pkgs/servers/x11/xorg/tarballs.list b/pkgs/servers/x11/xorg/tarballs.list index e6a9a3168897..608b66b093ea 100644 --- a/pkgs/servers/x11/xorg/tarballs.list +++ b/pkgs/servers/x11/xorg/tarballs.list @@ -24,7 +24,7 @@ mirror://xorg/individual/app/transset-1.0.2.tar.bz2 mirror://xorg/individual/app/twm-1.0.10.tar.bz2 mirror://xorg/individual/app/viewres-1.0.5.tar.bz2 mirror://xorg/individual/app/x11perf-1.6.1.tar.bz2 -mirror://xorg/individual/app/xauth-1.1.tar.bz2 +mirror://xorg/individual/app/xauth-1.1.2.tar.xz mirror://xorg/individual/app/xbacklight-1.2.3.tar.bz2 mirror://xorg/individual/app/xcalc-1.1.0.tar.bz2 mirror://xorg/individual/app/xclock-1.0.9.tar.bz2 @@ -101,7 +101,7 @@ mirror://xorg/individual/driver/xf86-video-glint-1.2.9.tar.bz2 mirror://xorg/individual/driver/xf86-video-i128-1.4.0.tar.bz2 mirror://xorg/individual/driver/xf86-video-i740-1.4.0.tar.bz2 mirror://xorg/individual/driver/xf86-video-intel-2.99.917.tar.bz2 -mirror://xorg/individual/driver/xf86-video-mga-2.0.0.tar.bz2 +mirror://xorg/individual/driver/xf86-video-mga-2.0.1.tar.xz mirror://xorg/individual/driver/xf86-video-neomagic-1.3.0.tar.bz2 mirror://xorg/individual/driver/xf86-video-newport-0.2.4.tar.bz2 https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau/-/archive/3ee7cbca8f9144a3bb5be7f71ce70558f548d268/xf86-video-nouveau-3ee7cbca8f9144a3bb5be7f71ce70558f548d268.tar.bz2 @@ -109,7 +109,7 @@ mirror://xorg/individual/driver/xf86-video-nv-2.1.21.tar.bz2 mirror://xorg/individual/driver/xf86-video-omap-0.4.5.tar.bz2 mirror://xorg/individual/driver/xf86-video-openchrome-0.6.0.tar.bz2 mirror://xorg/individual/driver/xf86-video-qxl-0.1.5.tar.bz2 -mirror://xorg/individual/driver/xf86-video-r128-6.11.0.tar.bz2 +mirror://xorg/individual/driver/xf86-video-r128-6.12.1.tar.xz mirror://xorg/individual/driver/xf86-video-rendition-4.2.7.tar.bz2 mirror://xorg/individual/driver/xf86-video-s3virge-1.11.0.tar.bz2 mirror://xorg/individual/driver/xf86-video-savage-2.3.9.tar.bz2 diff --git a/pkgs/shells/bash/5.1.nix b/pkgs/shells/bash/5.nix similarity index 85% rename from pkgs/shells/bash/5.1.nix rename to pkgs/shells/bash/5.nix index 458210873a68..6e16c083bc7c 100644 --- a/pkgs/shells/bash/5.1.nix +++ b/pkgs/shells/bash/5.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ lib +, stdenv , buildPackages , fetchurl , binutils @@ -14,25 +15,25 @@ }: let - upstreamPatches = import ./bash-5.1-patches.nix (nr: sha256: fetchurl { - url = "mirror://gnu/bash/bash-5.1-patches/bash51-${nr}"; + upstreamPatches = import ./bash-5.2-patches.nix (nr: sha256: fetchurl { + url = "mirror://gnu/bash/bash-5.2-patches/bash52-${nr}"; inherit sha256; }); in stdenv.mkDerivation rec { name = "bash-${lib.optionalString interactive "interactive-"}${version}-p${toString (builtins.length upstreamPatches)}"; - version = "5.1"; + version = "5.2"; src = fetchurl { url = "mirror://gnu/bash/bash-${version}.tar.gz"; - sha256 = "1alv68wplnfdm6mh39hm57060xgssb9vqca4yr1cyva0c342n0fc"; + sha256 = "sha256-oTnBZt9/9EccXgczBRZC7lVWwcyKSnjxRVg8XIGrMvs="; }; hardeningDisable = [ "format" ] - # bionic libc is super weird and has issues with fortify outside of its own libc, check this comment: - # https://github.com/NixOS/nixpkgs/pull/192630#discussion_r978985593 - # or you can check libc/include/sys/cdefs.h in bionic source code - ++ lib.optional (stdenv.hostPlatform.libc == "bionic") "fortify"; + # bionic libc is super weird and has issues with fortify outside of its own libc, check this comment: + # https://github.com/NixOS/nixpkgs/pull/192630#discussion_r978985593 + # or you can check libc/include/sys/cdefs.h in bionic source code + ++ lib.optional (stdenv.hostPlatform.libc == "bionic") "fortify"; outputs = [ "out" "dev" "man" "doc" "info" ]; @@ -50,7 +51,7 @@ stdenv.mkDerivation rec { patchFlags = [ "-p0" ]; patches = upstreamPatches - ++ [ ./pgrp-pipe-5.1.patch ]; + ++ [ ./pgrp-pipe-5.patch ]; configureFlags = [ (if interactive then "--with-installed-readline" else "--disable-readline") diff --git a/pkgs/shells/bash/bash-5.1-patches.nix b/pkgs/shells/bash/bash-5.1-patches.nix deleted file mode 100644 index 41eb92710588..000000000000 --- a/pkgs/shells/bash/bash-5.1-patches.nix +++ /dev/null @@ -1,20 +0,0 @@ -# Automatically generated by `update-patch-set.sh'; do not edit. - -patch: [ -(patch "001" "1ymm8ppss6gyh9ifznjwiabrb4k91npd09c10y7mk66xp8yppc7b") -(patch "002" "1gjx9zqcm407am3n2sh44b8dxm48kgm15rzfiijqxr01m0hn3shm") -(patch "003" "1cdnpbfc64yhvkjj4d12s9ywp11g195vzfl1cab24sq55wkcrwi2") -(patch "004" "11iwhy6v562bv0kk7lwj7f5jj65ma9bblivy0v02h3ggcibbdbls") -(patch "005" "19bdyigdr81824nxvqr6a7k0cax60wq7376j6b91afbnwvlvbjyc") -(patch "006" "051x8wlwrqk0yr0zg378vh824iklfl5g9pkmcdf62qp8gn9pvqbm") -(patch "007" "0fir80pp1gmlpadmqcgkrv4y119pc7xllchjzg05fd7px73viz5c") -(patch "008" "1lfjgshk8i9vch92p5wgc9r90j3phw79aa7gbai89w183b2z6b7j") -(patch "009" "1vn36dzd9g4y1h3jiss6418crla0rbcd0d6wwsyv9d5l7aaxlp74") -(patch "010" "0amfmvbzsand7bdypylkjdpcp88fa3cplfshn7vyzv2ff2rdgj52") -(patch "011" "0yq24abb4fzfxqnwl20b330sxl9lr9ds0nc4yi30f81l94b1y6aq") -(patch "012" "165bff97ffih49vfs4mkr5w3z5gn1w6zfyrf773iajkw6v48kw8h") -(patch "013" "1bfmgv3lagbk3aq9a831d29xv7jz4sjq7jhn9hq89limyinvdb67") -(patch "014" "1l43dw4kpddn7l41i8wmj406z9abxky1wb3rk8krcys33g4f0kka") -(patch "015" "1w40vzadzx019v0zhs4q6yqycrk04x1k8xs6qb73vk7ny4p6jdqv") -(patch "016" "0krqqljz4bkp9wrdnwfx51bxkb8rkwf8ivc93as1znx5fr7i96c8") -] diff --git a/pkgs/shells/bash/bash-5.2-patches.nix b/pkgs/shells/bash/bash-5.2-patches.nix new file mode 100644 index 000000000000..e118f03e0300 --- /dev/null +++ b/pkgs/shells/bash/bash-5.2-patches.nix @@ -0,0 +1,19 @@ +# Automatically generated by `update-patch-set.sh'; do not edit. + +patch: [ +(patch "001" "02iibpd3jq8p1bhdzgik8ps6gi1145vr463a82gj1hivjbp2ybzl") +(patch "002" "1f6p1z85qh1lavdp3xikgp0bfv0vqhvgpgwmdzlywl35hwdmxk25") +(patch "003" "1zxsi869jd90hksx3nyypgyqwrxhw2ws3r6hmk76yc1lsgdhq2ba") +(patch "004" "04i5liw5cg6dqkdxfgazqc2jrw40bmclx3dx45bwy259pcj7g0iq") +(patch "005" "0mykflv9qnbx3jz71l4f7isadiw9knm4qimqkwsv9cv88dafpq7c") +(patch "006" "13265akl8w6zyrg0l7f0x6arjgqjhllcwl6lk46rl53x4mm5dq6i") +(patch "007" "146lrwkn5wgxzs6vx34wl47g69zsxdy032k40qzi626b47ya6015") +(patch "008" "1s5i8hcayrv25lc8fxcr431v634yx5sii53b8fmip789s0pxjjvb") +(patch "009" "1kfk25151ka9wkmk1myf12irgcmvhsd8b0nfifvhrszah9w82npr") +(patch "010" "1kf1jrwm30js0v3d1r2rk4x09s1pyjp70wnd1qqhf9bmkw15ww67") +(patch "011" "1x5nkvbj6hci7gx42q7qa72hg2a9wwxh85dk79gn521ypwjmy6w3") +(patch "012" "0b6lcwzm7v5bzjiwaz2c8n5aj77w8ckhp2vwk4v3zsdq3z70gc9g") +(patch "013" "1rkwpibd6j2ghppfhqsva2jm4kdni6b7jpdsxdps52643gc4yjq9") +(patch "014" "09766vqqw4ffnmysm725v35qkhp1g9j4qgqag941xvq655pj9y9y") +(patch "015" "12im449abnq5gaqjmdxr5i38kmp02fa8l8wffad3jryvd58r0wzg") +] diff --git a/pkgs/shells/bash/pgrp-pipe-5.1.patch b/pkgs/shells/bash/pgrp-pipe-5.1.patch deleted file mode 100644 index 478327cafc45..000000000000 --- a/pkgs/shells/bash/pgrp-pipe-5.1.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -u ./configure ../bash-5.0-fixed/configure ---- ./configure 2019-01-02 15:43:31.000000000 +0100 -+++ ../bash-5.0-fixed/configure 2020-01-08 14:18:21.017296179 +0100 -@@ -16312,11 +16312,7 @@ - solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; - lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; - linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading -- case "`uname -r`" in -- 1.*|2.[0123]*) : ;; -- *) $as_echo "#define PGRP_PIPE 1" >>confdefs.h -- ;; -- esac ;; -+ $as_echo "#define PGRP_PIPE 1" >>confdefs.h ;; - netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;; - *qnx[67]*) LOCAL_LIBS="-lncurses" ;; - *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; diff --git a/pkgs/shells/bash/pgrp-pipe-5.patch b/pkgs/shells/bash/pgrp-pipe-5.patch new file mode 100644 index 000000000000..71b397901cb0 --- /dev/null +++ b/pkgs/shells/bash/pgrp-pipe-5.patch @@ -0,0 +1,15 @@ +--- ./configure 2022-12-20 17:13:17.804045620 +0100 ++++ ./configure-fixed 2022-12-20 17:16:00.444114824 +0100 +@@ -21723,11 +21723,7 @@ + solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; + lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; + linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading +- case "`uname -r`" in +- 1.*|2.[0123]*) : ;; +- *) printf "%s\n" "#define PGRP_PIPE 1" >>confdefs.h +- ;; +- esac ;; ++ printf "%s\n" "#define PGRP_PIPE 1" >>confdefs.h ;; + netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;; + freebsd*|midnightbsd*) LOCAL_CFLAGS='-DHEREDOC_PIPESIZE=4096' ;; + *qnx[67]*) LOCAL_LIBS="-lncurses" ;; diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 9a7cd9aa9dee..76c44870f4ad 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -262,11 +262,12 @@ rec { ln -s ${bootstrapTools}/bin/rewrite-tbd $out/bin ''; - binutils-unwrapped = { name = "bootstrap-stage0-binutils"; outPath = bootstrapTools; }; + binutils-unwrapped = bootstrapTools // { + name = "bootstrap-stage0-binutils"; + }; - cctools = { + cctools = bootstrapTools // { name = "bootstrap-stage0-cctools"; - outPath = bootstrapTools; targetPrefix = ""; }; diff --git a/pkgs/stdenv/generic/default-builder.sh b/pkgs/stdenv/generic/default-builder.sh index 273fc55c7552..8c6fec7873b6 100644 --- a/pkgs/stdenv/generic/default-builder.sh +++ b/pkgs/stdenv/generic/default-builder.sh @@ -1,2 +1,6 @@ +if [ -f .attrs.sh ]; then + . .attrs.sh +fi + source $stdenv/setup genericBuild diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 81255726284b..cf194be92bd7 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -57,28 +57,21 @@ argsStdenv@{ name ? "stdenv", preHook ? "", initialPath let defaultNativeBuildInputs = extraNativeBuildInputs ++ - [ ../../build-support/setup-hooks/move-docs.sh - ../../build-support/setup-hooks/make-symlinks-relative.sh + [ + ../../build-support/setup-hooks/audit-tmpdir.sh ../../build-support/setup-hooks/compress-man-pages.sh - ../../build-support/setup-hooks/strip.sh + ../../build-support/setup-hooks/make-symlinks-relative.sh + ../../build-support/setup-hooks/move-docs.sh + ../../build-support/setup-hooks/move-lib64.sh + ../../build-support/setup-hooks/move-sbin.sh + ../../build-support/setup-hooks/move-systemd-user-units.sh + ../../build-support/setup-hooks/multiple-outputs.sh ../../build-support/setup-hooks/patch-shebangs.sh ../../build-support/setup-hooks/prune-libtool-files.sh - ] - # FIXME this on Darwin; see - # https://github.com/NixOS/nixpkgs/commit/94d164dd7#commitcomment-22030369 - ++ lib.optionals hostPlatform.isLinux [ - ../../build-support/setup-hooks/audit-tmpdir.sh - ../../build-support/setup-hooks/move-systemd-user-units.sh - ] - ++ [ - ../../build-support/setup-hooks/multiple-outputs.sh - ../../build-support/setup-hooks/move-sbin.sh - ../../build-support/setup-hooks/move-lib64.sh - ../../build-support/setup-hooks/set-source-date-epoch-to-latest.sh ../../build-support/setup-hooks/reproducible-builds.sh - # TODO use lib.optional instead - (if hasCC then cc else null) - ]; + ../../build-support/setup-hooks/set-source-date-epoch-to-latest.sh + ../../build-support/setup-hooks/strip.sh + ] ++ lib.optionals hasCC [ cc ]; defaultBuildInputs = extraBuildInputs; diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 510537aac9f3..81fc31d67289 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -154,6 +154,12 @@ let (! attrs ? outputHash) # Fixed-output drvs can't be content addressed too && config.contentAddressedByDefault +# Experimental. For simple packages mostly just works, +# but for anything complex, be prepared to debug if enabling. +, __structuredAttrs ? config.structuredAttrsByDefault or false + +, env ? { } + , ... } @ attrs: let @@ -259,13 +265,16 @@ else let lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies)); + envIsExportable = lib.isAttrs env && !lib.isDerivation env; + derivationArg = (removeAttrs attrs - ["meta" "passthru" "pos" + (["meta" "passthru" "pos" "checkInputs" "installCheckInputs" "__darwinAllowLocalNetworking" "__impureHostDeps" "__propagatedImpureHostDeps" - "sandboxProfile" "propagatedSandboxProfile"]) + "sandboxProfile" "propagatedSandboxProfile"] + ++ lib.optional (__structuredAttrs || envIsExportable) "env")) // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) { name = let @@ -289,7 +298,7 @@ else let then attrs.name + hostSuffix else "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}" ); - }) // { + }) // lib.optionalAttrs __structuredAttrs { env = checkedEnv; } // { builder = attrs.realBuilder or stdenv.shell; args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; inherit stdenv; @@ -304,8 +313,7 @@ else let userHook = config.stdenv.userHook or null; __ignoreNulls = true; - - inherit strictDeps; + inherit __structuredAttrs strictDeps; depsBuildBuild = lib.elemAt (lib.elemAt dependencies 0) 0; nativeBuildInputs = lib.elemAt (lib.elemAt dependencies 0) 1; @@ -410,6 +418,7 @@ else let outputHashAlgo = attrs.outputHashAlgo or "sha256"; outputHashMode = attrs.outputHashMode or "recursive"; } // lib.optionalAttrs (enableParallelBuilding) { + inherit enableParallelBuilding; enableParallelChecking = attrs.enableParallelChecking or true; } // lib.optionalAttrs (hardeningDisable != [] || hardeningEnable != [] || stdenv.hostPlatform.isMusl) { NIX_HARDENING_ENABLE = enabledHardeningOptions; @@ -473,6 +482,19 @@ else let else true); }; + checkedEnv = + let + overlappingNames = lib.attrNames (builtins.intersectAttrs env derivationArg); + in + assert lib.assertMsg envIsExportable + "When using structured attributes, `env` must be an attribute set of environment variables."; + assert lib.assertMsg (overlappingNames == [ ]) + "The ‘env’ attribute set cannot contain any attributes passed to derivation. The following attributes are overlapping: ${lib.concatStringsSep ", " overlappingNames}"; + lib.mapAttrs + (n: v: assert lib.assertMsg (lib.isString v || lib.isBool v || lib.isInt v || lib.isDerivation v) + "The ‘env’ attribute set can only contain derivation, string, boolean or integer attributes. The ‘${n}’ attribute is of type ${builtins.typeOf v}."; v) + env; + in lib.extendDerivation @@ -509,7 +531,7 @@ lib.extendDerivation # should be made available to Nix expressions using the # derivation (e.g., in assertions). passthru) - (derivation derivationArg); + (derivation (derivationArg // lib.optionalAttrs envIsExportable checkedEnv)); in fnOrAttrs: diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index c6cdb6c3df75..b07420bb4185 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -15,8 +15,33 @@ if (( "${NIX_DEBUG:-0}" >= 6 )); then set -x fi -: ${outputs:=out} +if [ -f .attrs.sh ]; then + __structuredAttrs=1 + echo "structuredAttrs is enabled" +else + __structuredAttrs= +fi +if [ -n "$__structuredAttrs" ]; then + for outputName in "${!outputs[@]}"; do + # ex: out=/nix/store/... + export "$outputName=${outputs[$outputName]}" + done + # $NIX_ATTRS_JSON_FILE points to the wrong location in sandbox + # https://github.com/NixOS/nix/issues/6736 + export NIX_ATTRS_JSON_FILE="$NIX_BUILD_TOP/.attrs.json" + export NIX_ATTRS_SH_FILE="$NIX_BUILD_TOP/.attrs.sh" +else + : ${outputs:=out} +fi + +getAllOutputNames() { + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}" + else + echo "$outputs" + fi +} ###################################################################### # Hook handling. @@ -175,6 +200,109 @@ addToSearchPath() { addToSearchPathWithCustomDelimiter ":" "$@" } +# Prepend elements to variable "$1", which may come from an attr. +# +# This is useful in generic setup code, which must (for now) support +# both derivations with and without __structuredAttrs true, so the +# variable may be an array or a space-separated string. +# +# Expressions for individual packages should simply switch to array +# syntax when they switch to setting __structuredAttrs = true. +prependToVar() { + local -n nameref="$1" + + useArray= + if [ -n "$__structuredAttrs" ]; then + useArray=true + else + useArray=false + fi + + # check if variable already exist and if it does then do extra checks + if declare -p "$1" 2> /dev/null | grep -q '^'; then + type="$(declare -p "$1")" + if [[ "$type" =~ "declare -A" ]]; then + echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." >&2 + return 1 + elif [[ "$type" =~ "declare -a" ]]; then + useArray=true + else + useArray=false + fi + fi + + shift + + if $useArray; then + nameref=( "$@" ${nameref+"${nameref[@]}"} ) + else + nameref="$* ${nameref-}" + fi +} + +# Same as above +appendToVar() { + local -n nameref="$1" + + useArray= + if [ -n "$__structuredAttrs" ]; then + useArray=true + else + useArray=false + fi + + # check if variable already exist and if it does then do extra checks + if declare -p "$1" 2> /dev/null | grep -q '^'; then + type="$(declare -p "$1")" + if [[ "$type" =~ "declare -A" ]]; then + echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." >&2 + return 1 + elif [[ "$type" =~ "declare -a" ]]; then + useArray=true + else + useArray=false + fi + fi + + shift + + if $useArray; then + nameref=( ${nameref+"${nameref[@]}"} "$@" ) + else + nameref="${nameref-} $*" + fi +} + +# Accumulate into `flagsArray` the flags from the named variables. +# +# If __structuredAttrs, the variables are all treated as arrays +# and simply concatenated onto `flagsArray`. +# +# If not __structuredAttrs, then: +# * Each variable is treated as a string, and split on whitespace; +# * except variables whose names end in "Array", which are treated +# as arrays. +_accumFlagsArray() { + local name + if [ -n "$__structuredAttrs" ]; then + for name in "$@"; do + local -n nameref="$name" + flagsArray+=( ${nameref+"${nameref[@]}"} ) + done + else + for name in "$@"; do + local -n nameref="$name" + case "$name" in + *Array) + flagsArray+=( ${nameref+"${nameref[@]}"} ) ;; + *) + flagsArray+=( ${nameref-} ) ;; + esac + done + fi + +} + # Add $1/lib* into rpaths. # The function is used in multiple-outputs.sh hook, # so it is defined here but tried after the hook. @@ -255,6 +383,14 @@ printWords() { ###################################################################### # Initialisation. +# If using structured attributes, export variables from `env` to the environment. +# When not using structured attributes, those variables are already exported. +if [[ -n $__structuredAttrs ]]; then + for envVar in "${!env[@]}"; do + declare -x "${envVar}=${env[${envVar}]}" + done +fi + # Set a fallback default value for SOURCE_DATE_EPOCH, used by some build tools # to provide a deterministic substitute for the "current" time. Note that @@ -469,6 +605,10 @@ findInputs() { done } +# The way we handle deps* and *Inputs works with structured attrs +# either enabled or disabled. For this it's convenient that the items +# in each list must be store paths, and therefore space-free. + # Make sure all are at least defined as empty : ${depsBuildBuild=} ${depsBuildBuildPropagated=} : ${nativeBuildInputs=} ${propagatedNativeBuildInputs=} ${defaultNativeBuildInputs=} @@ -477,29 +617,29 @@ findInputs() { : ${buildInputs=} ${propagatedBuildInputs=} ${defaultBuildInputs=} : ${depsTargetTarget=} ${depsTargetTargetPropagated=} -for pkg in $depsBuildBuild $depsBuildBuildPropagated; do +for pkg in ${depsBuildBuild[@]} ${depsBuildBuildPropagated[@]}; do findInputs "$pkg" -1 -1 done -for pkg in $nativeBuildInputs $propagatedNativeBuildInputs; do +for pkg in ${nativeBuildInputs[@]} ${propagatedNativeBuildInputs[@]}; do findInputs "$pkg" -1 0 done -for pkg in $depsBuildTarget $depsBuildTargetPropagated; do +for pkg in ${depsBuildTarget[@]} ${depsBuildTargetPropagated[@]}; do findInputs "$pkg" -1 1 done -for pkg in $depsHostHost $depsHostHostPropagated; do +for pkg in ${depsHostHost[@]} ${depsHostHostPropagated[@]}; do findInputs "$pkg" 0 0 done -for pkg in $buildInputs $propagatedBuildInputs ; do +for pkg in ${buildInputs[@]} ${propagatedBuildInputs[@]} ; do findInputs "$pkg" 0 1 done -for pkg in $depsTargetTarget $depsTargetTargetPropagated; do +for pkg in ${depsTargetTarget[@]} ${depsTargetTargetPropagated[@]}; do findInputs "$pkg" 1 1 done # Default inputs must be processed last -for pkg in $defaultNativeBuildInputs; do +for pkg in ${defaultNativeBuildInputs[@]}; do findInputs "$pkg" -1 0 done -for pkg in $defaultBuildInputs; do +for pkg in ${defaultBuildInputs[@]}; do findInputs "$pkg" 0 1 done @@ -787,6 +927,10 @@ substituteInPlace() { } _allFlags() { + # export some local variables for the awk below + # so some substitutions such as name don't have to be in the env attrset + # when __structuredAttrs is enabled + export system pname name version for varName in $(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'); do if (( "${NIX_DEBUG:-0}" >= 1 )); then printf "@%s@ -> %q\n" "${varName}" "${!varName}" @@ -909,6 +1053,13 @@ unpackPhase() { srcs="$src" fi + local -a srcsArray + if [ -n "$__structuredAttrs" ]; then + srcsArray=( "${srcs[@]}" ) + else + srcsArray=( $srcs ) + fi + # To determine the source directory created by unpacking the # source archives, we record the contents of the current # directory, then look below which directory got added. Yeah, @@ -921,7 +1072,7 @@ unpackPhase() { done # Unpack all source archives. - for i in $srcs; do + for i in "${srcsArray[@]}"; do unpackFile "$i" done @@ -971,7 +1122,14 @@ unpackPhase() { patchPhase() { runHook prePatch - for i in ${patches:-}; do + local -a patchesArray + if [ -n "$__structuredAttrs" ]; then + patchesArray=( ${patches:+"${patches[@]}"} ) + else + patchesArray=( ${patches:-} ) + fi + + for i in "${patchesArray[@]}"; do header "applying patch $i" 3 local uncompress=cat case "$i" in @@ -988,9 +1146,17 @@ patchPhase() { uncompress="lzma -d" ;; esac + + local -a flagsArray + if [ -n "$__structuredAttrs" ]; then + flagsArray=( "${patchFlags[@]:--p1}" ) + else + # shellcheck disable=SC2086 + flagsArray=( ${patchFlags:--p1} ) + fi # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.) # shellcheck disable=SC2086 - $uncompress < "$i" 2>&1 | patch ${patchFlags:--p1} + $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}" done runHook postPatch @@ -1018,7 +1184,6 @@ configurePhase() { # set to empty if unset : ${configureScript=} - : ${configureFlags=} if [[ -z "$configureScript" && -x ./configure ]]; then configureScript=./configure @@ -1049,31 +1214,29 @@ configurePhase() { fi if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - configureFlags="${prefixKey:---prefix=}$prefix $configureFlags" + prependToVar configureFlags "${prefixKey:---prefix=}$prefix" fi if [[ -f "$configureScript" ]]; then # Add --disable-dependency-tracking to speed up some builds. if [ -z "${dontAddDisableDepTrack:-}" ]; then if grep -q dependency-tracking "$configureScript"; then - configureFlags="--disable-dependency-tracking $configureFlags" + prependToVar configureFlags --disable-dependency-tracking fi fi # By default, disable static builds. if [ -z "${dontDisableStatic:-}" ]; then if grep -q enable-static "$configureScript"; then - configureFlags="--disable-static $configureFlags" + prependToVar configureFlags --disable-static fi fi fi if [ -n "$configureScript" ]; then - # Old bash empty array hack - # shellcheck disable=SC2086 - local flagsArray=( - $configureFlags "${configureFlagsArray[@]}" - ) + local -a flagsArray + _accumFlagsArray configureFlags configureFlagsArray + echoCmd 'configure flags' "${flagsArray[@]}" # shellcheck disable=SC2086 $configureScript "${flagsArray[@]}" @@ -1089,22 +1252,17 @@ configurePhase() { buildPhase() { runHook preBuild - # set to empty if unset - : ${makeFlags=} - - if [[ -z "$makeFlags" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then echo "no Makefile, doing nothing" else foundMakefile=1 - # Old bash empty array hack # shellcheck disable=SC2086 local flagsArray=( ${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL=$SHELL - $makeFlags "${makeFlagsArray[@]}" - $buildFlags "${buildFlagsArray[@]}" ) + _accumFlagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray echoCmd 'build flags' "${flagsArray[@]}" make ${makefile:+-f $makefile} "${flagsArray[@]}" @@ -1141,11 +1299,17 @@ checkPhase() { local flagsArray=( ${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL - $makeFlags "${makeFlagsArray[@]}" - ${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" - ${checkTarget} ) + _accumFlagsArray makeFlags makeFlagsArray + if [ -n "$__structuredAttrs" ]; then + flagsArray+=( "${checkFlags[@]:-VERBOSE=y}" ) + else + flagsArray+=( ${checkFlags:-VERBOSE=y} ) + fi + _accumFlagsArray checkFlagsArray + flagsArray+=( ${checkTarget} ) + echoCmd 'check flags' "${flagsArray[@]}" make ${makefile:+-f $makefile} "${flagsArray[@]}" @@ -1163,14 +1327,16 @@ installPhase() { mkdir -p "$prefix" fi - # Old bash empty array hack # shellcheck disable=SC2086 local flagsArray=( SHELL=$SHELL - $makeFlags "${makeFlagsArray[@]}" - $installFlags "${installFlagsArray[@]}" - ${installTargets:-install} ) + _accumFlagsArray makeFlags makeFlagsArray installFlags installFlagsArray + if [ -n "$__structuredAttrs" ]; then + flagsArray+=( "${installTargets[@]:-install}" ) + else + flagsArray+=( ${installTargets:-install} ) + fi echoCmd 'install flags' "${flagsArray[@]}" make ${makefile:+-f $makefile} "${flagsArray[@]}" @@ -1186,7 +1352,7 @@ installPhase() { fixupPhase() { # Make sure everything is writable so "strip" et al. work. local output - for output in $outputs; do + for output in $(getAllOutputNames); do if [ -e "${!output}" ]; then chmod -R u+w "${!output}"; fi done @@ -1194,7 +1360,7 @@ fixupPhase() { # Apply fixup to each output. local output - for output in $outputs; do + for output in $(getAllOutputNames); do prefix="${!output}" runHook fixupOutput done @@ -1239,7 +1405,10 @@ fixupPhase() { if [ -n "${setupHooks:-}" ]; then mkdir -p "${!outputDev}/nix-support" local hook - for hook in $setupHooks; do + # have to use ${setupHooks[@]} without quotes because it needs to support setupHooks being a array or a whitespace separated string + # # values of setupHooks won't have spaces so it won't cause problems + # shellcheck disable=2068 + for hook in ${setupHooks[@]}; do local content consumeEntire content < "$hook" substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook" @@ -1275,11 +1444,12 @@ installCheckPhase() { local flagsArray=( ${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL - $makeFlags "${makeFlagsArray[@]}" - $installCheckFlags "${installCheckFlagsArray[@]}" - ${installCheckTarget:-installcheck} ) + _accumFlagsArray makeFlags makeFlagsArray \ + installCheckFlags installCheckFlagsArray + flagsArray+=( ${installCheckTarget:-installcheck} ) + echoCmd 'installcheck flags' "${flagsArray[@]}" make ${makefile:+-f $makefile} "${flagsArray[@]}" unset flagsArray @@ -1292,11 +1462,9 @@ installCheckPhase() { distPhase() { runHook preDist - # Old bash empty array hack - # shellcheck disable=SC2086 - local flagsArray=( - $distFlags "${distFlagsArray[@]}" ${distTarget:-dist} - ) + local flagsArray=() + _accumFlagsArray distFlags distFlagsArray + flagsArray+=( ${distTarget:-dist} ) echo 'dist flags: %q' "${flagsArray[@]}" make ${makefile:+-f $makefile} "${flagsArray[@]}" @@ -1307,7 +1475,7 @@ distPhase() { # Note: don't quote $tarballs, since we explicitly permit # wildcards in there. # shellcheck disable=SC2086 - cp -pvd ${tarballs:-*.tar.gz} "$out/tarballs" + cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs" fi runHook postDist @@ -1357,14 +1525,18 @@ genericBuild() { return fi - if [ -z "${phases:-}" ]; then - phases="${prePhases:-} unpackPhase patchPhase ${preConfigurePhases:-} \ - configurePhase ${preBuildPhases:-} buildPhase checkPhase \ - ${preInstallPhases:-} installPhase ${preFixupPhases:-} fixupPhase installCheckPhase \ - ${preDistPhases:-} distPhase ${postPhases:-}"; + if [ -z "${phases[*]:-}" ]; then + phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} \ + configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase \ + ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase \ + ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; fi - for curPhase in $phases; do + # The use of ${phases[*]} gives the correct behavior both with and + # without structured attrs. This relies on the fact that each + # phase name is space-free, which it must be because it's the name + # of either a shell variable or a shell function. + for curPhase in ${phases[*]}; do if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then continue; fi if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then continue; fi if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then continue; fi @@ -1414,6 +1586,7 @@ runHook userHook dumpVars + # Restore the original options for nix-shell [[ $__nixpkgs_setup_set_original == *e* ]] || set +e [[ $__nixpkgs_setup_set_original == *u* ]] || set +u diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 5116de980348..870fb04c3883 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -312,7 +312,7 @@ in # Apparently iconv won't work with bootstrap glibc, but it will be used # with glibc built later where we keep *this* build of libunistring, # so we need to trick it into supporting libiconv. - am_cv_func_iconv_works = "yes"; + env = attrs.env or {} // { am_cv_func_iconv_works = "yes"; }; }); libidn2 = super.libidn2.overrideAttrs (attrs: { postFixup = attrs.postFixup or "" + '' diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix index bf0842f26698..818001018b3a 100644 --- a/pkgs/test/default.nix +++ b/pkgs/test/default.nix @@ -21,11 +21,14 @@ with pkgs; cc-wrapper-clang-9 = callPackage ./cc-wrapper { stdenv = llvmPackages_9.stdenv; }; cc-wrapper-libcxx-9 = callPackage ./cc-wrapper { stdenv = llvmPackages_9.libcxxStdenv; }; stdenv-inputs = callPackage ./stdenv-inputs { }; + stdenv = callPackage ./stdenv { }; config = callPackage ./config.nix { }; haskell = callPackage ./haskell { }; + hooks = callPackage ./hooks { }; + cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; }; cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; }; diff --git a/pkgs/test/hooks/default.nix b/pkgs/test/hooks/default.nix new file mode 100644 index 000000000000..aabf939b6865 --- /dev/null +++ b/pkgs/test/hooks/default.nix @@ -0,0 +1,8 @@ +# To run these tests: +# nix-build -A tests.hooks + +{ stdenv, tests, lib }: + +{ + default-stdenv-hooks = lib.recurseIntoAttrs tests.stdenv.hooks; +} diff --git a/pkgs/test/simple/builder.sh b/pkgs/test/simple/builder.sh index 65f7e4c11ba1..908faec3c388 100644 --- a/pkgs/test/simple/builder.sh +++ b/pkgs/test/simple/builder.sh @@ -1,3 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi set -x export NIX_DEBUG=1 diff --git a/pkgs/test/stdenv/default.nix b/pkgs/test/stdenv/default.nix new file mode 100644 index 000000000000..5ff18298f217 --- /dev/null +++ b/pkgs/test/stdenv/default.nix @@ -0,0 +1,256 @@ +# To run these tests: +# nix-build -A tests.stdenv + +{ stdenv +, pkgs +, lib +, +}: + +let + # early enough not to rebuild gcc but late enough to have patchelf + earlyPkgs = stdenv.__bootPackages.stdenv.__bootPackages; + # use a early stdenv so when hacking on stdenv this test can be run quickly + bootStdenv = stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv; + pkgsStructured = import pkgs.path { config = { structuredAttrsByDefault = true; }; inherit (stdenv.hostPlatform) system; }; + bootStdenvStructuredAttrsByDefault = pkgsStructured.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv; + + + ccWrapperSubstitutionsTest = { name, stdenv', extraAttrs ? { } }: + + stdenv'.cc.overrideAttrs (previousAttrs: ({ + inherit name; + + postFixup = previousAttrs.postFixup + '' + declare -p wrapperName + echo "env.wrapperName = $wrapperName" + [[ $wrapperName == "CC_WRAPPER" ]] || (echo "'\$wrapperName' was not 'CC_WRAPPER'" && false) + declare -p suffixSalt + echo "env.suffixSalt = $suffixSalt" + [[ $suffixSalt == "${stdenv'.cc.suffixSalt}" ]] || (echo "'\$suffxSalt' was not '${stdenv'.cc.suffixSalt}'" && false) + + grep -q "@out@" $out/bin/cc || echo "@out@ in $out/bin/cc was substituted" + grep -q "@suffixSalt@" $out/bin/cc && (echo "$out/bin/cc contains unsubstituted variables" && false) + + touch $out + ''; + } // extraAttrs)); + + testEnvAttrset = { name, stdenv', extraAttrs ? { } }: + stdenv'.mkDerivation + ({ + inherit name; + env = { + string = "testing-string"; + }; + + passAsFile = [ "buildCommand" ]; + buildCommand = '' + declare -p string + echo "env.string = $string" + [[ $string == "testing-string" ]] || (echo "'\$string' was not 'testing-string'" && false) + [[ "$(declare -p string)" == 'declare -x string="testing-string"' ]] || (echo "'\$string' was not exported" && false) + touch $out + ''; + } // extraAttrs); + + testPrependAndAppendToVar = { name, stdenv', extraAttrs ? { } }: + stdenv'.mkDerivation + ({ + inherit name; + env = { + string = "testing-string"; + }; + + passAsFile = [ "buildCommand" ] ++ lib.optionals (extraAttrs ? extraTest) [ "extraTest" ]; + buildCommand = '' + declare -p string + appendToVar string hello + # test that quoted strings work + prependToVar string "world" + declare -p string + + declare -A associativeArray=(["X"]="Y") + [[ $(appendToVar associativeArray "fail" 2>&1) =~ "trying to use" ]] || (echo "prependToVar did not catch prepending associativeArray" && false) + [[ $(prependToVar associativeArray "fail" 2>&1) =~ "trying to use" ]] || (echo "prependToVar did not catch prepending associativeArray" && false) + + [[ $string == "world testing-string hello" ]] || (echo "'\$string' was not 'world testing-string hello'" && false) + + # test appending to a unset variable + appendToVar nonExistant created hello + typeset -p nonExistant + if [[ -n $__structuredAttrs ]]; then + [[ "''${nonExistant[@]}" == "created hello" ]] + else + # there's a extra " " in front here and a extra " " in the end of prependToVar + # shouldn't matter because these functions will mostly be used for $*Flags and the Flag variable will in most cases already exit + [[ "$nonExistant" == " created hello" ]] + fi + + eval "$extraTest" + + touch $out + ''; + } // extraAttrs); + +in + +{ + # tests for hooks in `stdenv.defaultNativeBuildInputs` + hooks = lib.recurseIntoAttrs (import ./hooks.nix { stdenv = bootStdenv; pkgs = earlyPkgs; }); + + test-env-attrset = testEnvAttrset { name = "test-env-attrset"; stdenv' = bootStdenv; }; + + # Test compatibility with derivations using `env` as a regular variable. + test-env-derivation = bootStdenv.mkDerivation rec { + name = "test-env-derivation"; + env = bootStdenv.mkDerivation { + name = "foo"; + buildCommand = '' + mkdir "$out" + touch "$out/bar" + ''; + }; + + passAsFile = [ "buildCommand" ]; + buildCommand = '' + declare -p env + [[ $env == "${env}" ]] + touch "$out" + ''; + }; + + test-prepend-append-to-var = testPrependAndAppendToVar { + name = "test-prepend-append-to-var"; + stdenv' = bootStdenv; + }; + + test-structured-env-attrset = testEnvAttrset { + name = "test-structured-env-attrset"; + stdenv' = bootStdenv; + extraAttrs = { __structuredAttrs = true; }; + }; + + test-cc-wrapper-substitutions = ccWrapperSubstitutionsTest { + name = "test-cc-wrapper-substitutions"; + stdenv' = bootStdenv; + }; + + structuredAttrsByDefault = lib.recurseIntoAttrs { + + hooks = lib.recurseIntoAttrs (import ./hooks.nix { stdenv = bootStdenvStructuredAttrsByDefault; pkgs = earlyPkgs; }); + + test-cc-wrapper-substitutions = ccWrapperSubstitutionsTest { + name = "test-cc-wrapper-substitutions-structuredAttrsByDefault"; + stdenv' = bootStdenvStructuredAttrsByDefault; + }; + + test-structured-env-attrset = testEnvAttrset { + name = "test-structured-env-attrset-structuredAttrsByDefault"; + stdenv' = bootStdenvStructuredAttrsByDefault; + }; + + test-prepend-append-to-var = testPrependAndAppendToVar { + name = "test-prepend-append-to-var-structuredAttrsByDefault"; + stdenv' = bootStdenvStructuredAttrsByDefault; + extraAttrs = { + # will be a bash indexed array in attrs.sh + # declare -a list=('a' 'b' ) + # and a json array in attrs.json + # "list":["a","b"] + list = [ "a" "b" ]; + # will be a bash associative array(dictionary) in attrs.sh + # declare -A array=(['a']='1' ['b']='2' ) + # and a json object in attrs.json + # {"array":{"a":"1","b":"2"} + array = { a = "1"; b = "2"; }; + extraTest = '' + declare -p array + array+=(["c"]="3") + declare -p array + + [[ "''${array[c]}" == "3" ]] || (echo "c element of '\$array' was not '3'" && false) + + declare -p list + prependToVar list hello + # test that quoted strings work + appendToVar list "world" + declare -p list + + [[ "''${list[0]}" == "hello" ]] || (echo "first element of '\$list' was not 'hello'" && false) + [[ "''${list[1]}" == "a" ]] || (echo "first element of '\$list' was not 'a'" && false) + [[ "''${list[-1]}" == "world" ]] || (echo "last element of '\$list' was not 'world'" && false) + ''; + }; + }; + + test-golden-example-structuredAttrs = + let + goldenSh = earlyPkgs.writeText "goldenSh" '' + declare -A EXAMPLE_ATTRS=(['foo']='bar' ) + declare EXAMPLE_BOOL_FALSE= + declare EXAMPLE_BOOL_TRUE=1 + declare EXAMPLE_INT=123 + declare EXAMPLE_INT_NEG=-123 + declare -a EXAMPLE_LIST=('foo' 'bar' ) + declare EXAMPLE_STR='foo bar' + ''; + goldenJson = earlyPkgs.writeText "goldenSh" '' + { + "EXAMPLE_ATTRS": { + "foo": "bar" + }, + "EXAMPLE_BOOL_FALSE": false, + "EXAMPLE_BOOL_TRUE": true, + "EXAMPLE_INT": 123, + "EXAMPLE_INT_NEG": -123, + "EXAMPLE_LIST": [ + "foo", + "bar" + ], + "EXAMPLE_NESTED_ATTRS": { + "foo": { + "bar": "baz" + } + }, + "EXAMPLE_NESTED_LIST": [ + [ + "foo", + "bar" + ], + [ + "baz" + ] + ], + "EXAMPLE_STR": "foo bar" + } + ''; + in + bootStdenvStructuredAttrsByDefault.mkDerivation { + name = "test-golden-example-structuredAttrsByDefault"; + nativeBuildInputs = [ earlyPkgs.jq ]; + + EXAMPLE_BOOL_TRUE = true; + EXAMPLE_BOOL_FALSE = false; + EXAMPLE_INT = 123; + EXAMPLE_INT_NEG = -123; + EXAMPLE_STR = "foo bar"; + EXAMPLE_LIST = [ "foo" "bar" ]; + EXAMPLE_NESTED_LIST = [ [ "foo" "bar" ] [ "baz" ] ]; + EXAMPLE_ATTRS = { foo = "bar"; }; + EXAMPLE_NESTED_ATTRS = { foo.bar = "baz"; }; + + inherit goldenSh; + inherit goldenJson; + + buildCommand = '' + mkdir -p $out + cat $NIX_ATTRS_SH_FILE | grep "EXAMPLE" | grep -v -E 'installPhase|jq' > $out/sh + jq 'with_entries(select(.key|match("EXAMPLE")))' $NIX_ATTRS_JSON_FILE > $out/json + diff $out/sh $goldenSh + diff $out/json $goldenJson + ''; + }; + + }; +} diff --git a/pkgs/test/stdenv/hooks.nix b/pkgs/test/stdenv/hooks.nix new file mode 100644 index 000000000000..7f25d7dbd2db --- /dev/null +++ b/pkgs/test/stdenv/hooks.nix @@ -0,0 +1,126 @@ +{ stdenv, pkgs }: + +# ordering should match defaultNativeBuildInputs + +{ + # TODO: add audit-tmpdir + compress-man-pages = + let + manFile = pkgs.writeText "small-man" '' + .TH HELLO "1" "May 2022" "hello 2.12.1" "User Commands" + .SH NAME + hello - friendly greeting program + ''; + in + stdenv.mkDerivation { + name = "test-compress-man-pages"; + buildCommand = '' + mkdir -p $out/share/man + cp ${manFile} $out/share/man/small-man.1 + compressManPages $out + [[ -e $out/share/man/small-man.1.gz ]] + ''; + }; + make-symlinks-relative = stdenv.mkDerivation { + name = "test-make-symlinks-relative"; + buildCommand = '' + mkdir -p $out/{bar,baz} + source1="$out/bar/foo" + destination1="$out/baz/foo" + echo foo > $source1 + ln -s $source1 $destination1 + echo "symlink before patching: $(readlink $destination1)" + + _makeSymlinksRelative + + echo "symlink after patching: $(readlink $destination1)" + ([[ -e $destination1 ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1) + ([[ $(readlink $destination1) == "../bar/foo" ]] && echo "absolute symlink was made relative") || (echo "symlink was not made relative" && exit 1) + ''; + }; + move-docs = stdenv.mkDerivation { + name = "test-move-docs"; + buildCommand = '' + mkdir -p $out/{man,doc,info} + touch $out/{man,doc,info}/foo + cat $out/{man,doc,info}/foo + + _moveToShare + + (cat $out/share/{man,doc,info}/foo 2>/dev/null && echo "man,doc,info were moved") || (echo "man,doc,info were not moved" && exit 1) + ''; + }; + move-lib64 = stdenv.mkDerivation { + name = "test-move-lib64"; + buildCommand = '' + mkdir -p $out/lib64 + touch $out/lib64/foo + cat $out/lib64/foo + + _moveLib64 + + # check symlink + [[ -h $out/lib64 ]] + ([[ -e $out/lib64 ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1) + [[ -e $out/lib/foo ]] + ''; + }; + move-sbin = stdenv.mkDerivation { + name = "test-move-sbin"; + buildCommand = '' + mkdir -p $out/sbin + touch $out/sbin/foo + cat $out/sbin/foo + + _moveSbin + + # check symlink + [[ -h $out/sbin ]] + ([[ -e $out/sbin ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1) + [[ -e $out/bin/foo ]] + ''; + }; + # TODO: add multiple-outputs + # TODO: move patch-shebangs test from pkgs/test/patch-shebangs/default.nix to here + prune-libtool-files = + let + libFoo = pkgs.writeText "libFoo" '' + # Generated by libtool (GNU libtool) 2.4.6 + old_library=''' + dependency_libs=' -Lbar.la -Lbaz.la' + ''; + in + stdenv.mkDerivation { + name = "test-prune-libtool-files"; + buildCommand = '' + mkdir -p $out/lib + cp ${libFoo} $out/lib/libFoo.la + _pruneLibtoolFiles + grep "^dependency_libs=''' #pruned" $out/lib/libFoo.la + # confirm file doesn't only contain the above + grep "^old_library='''" $out/lib/libFoo.la + ''; + }; + reproducible-builds = stdenv.mkDerivation { + name = "test-reproducible-builds"; + buildCommand = '' + # can't be tested more precisely because the value of random-seed changes depending on the output + [[ $NIX_CFLAGS_COMPILE =~ "-frandom-seed=" ]] + touch $out + ''; + }; + set-source-date-epoch-to-latest = stdenv.mkDerivation { + name = "test-set-source-date-epoch-to-latest"; + buildCommand = '' + sourceRoot=$NIX_BUILD_TOP/source + mkdir -p $sourceRoot + touch --date=1/1/2015 $sourceRoot/foo + + _updateSourceDateEpochFromSourceRoot + + [[ $SOURCE_DATE_EPOCH == "1420070400" ]] + touch $out + ''; + }; + # TODO: add strip +} diff --git a/pkgs/tools/admin/awscli/default.nix b/pkgs/tools/admin/awscli/default.nix index 34fd3e45906f..3438580c7f22 100644 --- a/pkgs/tools/admin/awscli/default.nix +++ b/pkgs/tools/admin/awscli/default.nix @@ -28,11 +28,11 @@ let in with py.pkgs; buildPythonApplication rec { pname = "awscli"; - version = "1.25.76"; # N.B: if you change this, change botocore and boto3 to a matching version too + version = "1.27.38"; # N.B: if you change this, change botocore and boto3 to a matching version too src = fetchPypi { inherit pname version; - hash = "sha256-PSr0zZEGXFxcFSN7QQ5Ux0Z4aCwwm9na+2hIv/gR6+s="; + hash = "sha256-SjeFBWwfd+9sXcZL9NdqFyuBIQtql3KB3lnygeVVHU0="; }; # https://github.com/aws/aws-cli/issues/4837 @@ -82,6 +82,7 @@ with py.pkgs; buildPythonApplication rec { meta = with lib; { homepage = "https://aws.amazon.com/cli/"; + changelog = "https://github.com/aws/aws-cli/blob/${version}/CHANGELOG.rst"; description = "Unified tool to manage your AWS services"; license = licenses.asl20; mainProgram = "aws"; diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix index abc19356c950..59f1901bd9fd 100644 --- a/pkgs/tools/compression/xz/default.nix +++ b/pkgs/tools/compression/xz/default.nix @@ -10,11 +10,11 @@ stdenv.mkDerivation rec { pname = "xz"; - version = "5.2.9"; + version = "5.4.0"; src = fetchurl { url = "https://tukaani.org/xz/xz-${version}.tar.bz2"; - sha256 = "sZRQf7o6Rip1PFUxSczaoWgze8t97v3dBnuph8g9/OY="; + sha256 = "eV6gSUxm1QmwUt3DbcY71jTln/Kg85wWo7VkTdAdh+Y="; }; strictDeps = true; @@ -45,7 +45,8 @@ stdenv.mkDerivation rec { # Expect the text in format of '>xz-5.2.6.tar.bz2' # We pick first match where a stable release goes first. new_version="$(curl -s https://tukaani.org/xz/ | - pcregrep -o1 '>xz-([0-9.]+)[.]tar[.]bz2')" + pcregrep -o1 '>xz-([0-9.]+)[.]tar[.]bz2' | + head -n1)" update-source-version ${pname} "$new_version" ''; }; diff --git a/pkgs/tools/graphics/mesa-demos/default.nix b/pkgs/tools/graphics/mesa-demos/default.nix index 11ca657ebfed..efc58c370736 100644 --- a/pkgs/tools/graphics/mesa-demos/default.nix +++ b/pkgs/tools/graphics/mesa-demos/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetchurl, freeglut, glew, libGL, libGLU, libX11, libXext, mesa +{ lib, stdenv, fetchurl, fetchpatch +, freeglut, glew, libGL, libGLU, libX11, libXext, mesa , meson, ninja, pkg-config, wayland, wayland-protocols }: stdenv.mkDerivation rec { @@ -13,21 +14,31 @@ stdenv.mkDerivation rec { patches = [ # https://gitlab.freedesktop.org/mesa/demos/-/merge_requests/83 ./demos-data-dir.patch + + (fetchpatch { + url = "https://gitlab.freedesktop.org/mesa/demos/-/commit/b6d183f9943a275990aef7f08773e54c597572e5.patch"; + sha256 = "4UdV+cxvNRqoT+Pdy0gkCPXJbhFr6CSCw/UOOB+rvuw="; + }) ]; buildInputs = [ - freeglut glew libX11 libXext libGL libGLU mesa mesa.osmesa wayland + freeglut glew libX11 libXext libGL libGLU mesa wayland wayland-protocols - ]; + ] ++ lib.optional (mesa ? osmesa) mesa.osmesa ; nativeBuildInputs = [ meson ninja pkg-config ]; - mesonFlags = [ "-Dwith-system-data-files=true" ]; + mesonFlags = [ + "-Degl=${if stdenv.isDarwin then "disabled" else "auto"}" + "-Dlibdrm=${if mesa.libdrm == null then "disabled" else "enabled"}" + "-Dosmesa=${if mesa ? osmesa then "enabled" else "disabled"}" + "-Dwayland=${if wayland.withLibraries then "enabled" else "disabled"}" + "-Dwith-system-data-files=true" + ]; meta = with lib; { + inherit (mesa.meta) homepage platforms; description = "Collection of demos and test programs for OpenGL and Mesa"; - homepage = "https://www.mesa3d.org/"; license = licenses.mit; - platforms = platforms.linux; maintainers = with maintainers; [ andersk ]; }; } diff --git a/pkgs/tools/graphics/vulkan-extension-layer/default.nix b/pkgs/tools/graphics/vulkan-extension-layer/default.nix index 6a8056dfe41d..bf60e8ed85f3 100644 --- a/pkgs/tools/graphics/vulkan-extension-layer/default.nix +++ b/pkgs/tools/graphics/vulkan-extension-layer/default.nix @@ -2,14 +2,14 @@ stdenv.mkDerivation rec { pname = "vulkan-extension-layer"; - version = "1.3.231.0"; + version = "1.3.236.0"; src = (assert version == vulkan-headers.version; fetchFromGitHub { owner = "KhronosGroup"; repo = "Vulkan-ExtensionLayer"; rev = "sdk-${version}"; - hash = "sha256-8Z9w+3WFPYp8QKEUVkEQCGy9LXMWYlZDgGt8i34T5DU="; + hash = "sha256-NlBS7UuV2AZPY5VyoqTnTf63M7fHIPQDZRtMZ4XwMzA="; }); nativeBuildInputs = [ cmake jq ]; diff --git a/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix b/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix index e8d3907251ba..11cef8eeb886 100644 --- a/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix +++ b/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix @@ -11,6 +11,7 @@ , libffi , libxcb , wayland +, which , xcbutilkeysyms , xcbutilwm , vulkan-headers @@ -23,18 +24,18 @@ stdenv.mkDerivation rec { pname = "vulkan-tools-lunarg"; # The version must match that in vulkan-headers - version = "1.3.231.0"; + version = "1.3.236.0"; src = (assert version == vulkan-headers.version; fetchFromGitHub { owner = "LunarG"; repo = "VulkanTools"; rev = "sdk-${version}"; - hash = "sha256-qomhouuKVv4Dat9Sv7X68Dw6bRnaUjj6iEXC9pCqX4E="; + hash = "sha256-0dGD3InmEd9hO8+uVGMqBHXXfyX8tswyuOaZCftudz0="; fetchSubmodules = true; }); - nativeBuildInputs = [ cmake python3 jq ]; + nativeBuildInputs = [ cmake python3 jq which ]; buildInputs = [ expat diff --git a/pkgs/tools/graphics/vulkan-tools/default.nix b/pkgs/tools/graphics/vulkan-tools/default.nix index cb3fb8456a8d..8e94997db6c8 100644 --- a/pkgs/tools/graphics/vulkan-tools/default.nix +++ b/pkgs/tools/graphics/vulkan-tools/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { pname = "vulkan-tools"; - version = "1.3.231.0"; + version = "1.3.236.0"; # It's not strictly necessary to have matching versions here, however # since we're using the SDK version we may as well be consistent with @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { owner = "KhronosGroup"; repo = "Vulkan-Tools"; rev = "sdk-${version}"; - hash = "sha256-6oimP4ISa0dX4bLU3Nch8Ur6MzEMQscnL8EfRrqT/Es="; + hash = "sha256-PmNTpdAkXJkARLohRtUOuKTZPoKgeVF4DAo1wsAq5xE="; }); nativeBuildInputs = [ diff --git a/pkgs/tools/misc/fd/default.nix b/pkgs/tools/misc/fd/default.nix index 18169a794384..85bc47dab545 100644 --- a/pkgs/tools/misc/fd/default.nix +++ b/pkgs/tools/misc/fd/default.nix @@ -13,6 +13,8 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-PT95U1l+BVX7sby3GKktZMmbNNQoPYR8nL+H90EnqZY="; + auditable = true; # TODO: remove when this is the default + nativeBuildInputs = [ installShellFiles ]; # skip flaky test diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 6d5f28e7a82f..311e9e1b8c76 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -47,14 +47,14 @@ assert !(opensslSupport && wolfsslSupport); stdenv.mkDerivation (finalAttrs: { pname = "curl"; - version = "7.86.0"; + version = "7.87.0"; src = fetchurl { urls = [ "https://curl.haxx.se/download/curl-${finalAttrs.version}.tar.bz2" "https://github.com/curl/curl/releases/download/curl-${finalAttrs.version}/curl-${finalAttrs.version}.tar.bz2" ]; - sha256 = "sha256-9cpp2wPuoX+ocFvfsan1jXakbJAQUYEJuzjzExN+Cig="; + hash = "sha256-XW4Sh2G3EQlG0Sdq/28PJm8rcm9eYZ9+CgV6R0FV8wc="; }; patches = [ diff --git a/pkgs/tools/networking/dnsmasq/default.nix b/pkgs/tools/networking/dnsmasq/default.nix index 1eb8b85166fe..6d4e28f6cb6b 100644 --- a/pkgs/tools/networking/dnsmasq/default.nix +++ b/pkgs/tools/networking/dnsmasq/default.nix @@ -18,11 +18,11 @@ let in stdenv.mkDerivation rec { pname = "dnsmasq"; - version = "2.87"; + version = "2.88"; src = fetchurl { url = "https://www.thekelleys.org.uk/dnsmasq/${pname}-${version}.tar.xz"; - sha256 = "sha256-AijANkp/I1b9fn8VSZN8vzCZp407LrG6W7DDHiuJ3no="; + sha256 = "sha256-I1RN7aEDQMBTvqbxWpP+1up/WqqFMWv8Zx/6bSL7wbM="; }; postPatch = lib.optionalString stdenv.hostPlatform.isLinux '' diff --git a/pkgs/tools/networking/x11-ssh-askpass/default.nix b/pkgs/tools/networking/x11-ssh-askpass/default.nix index 2dc17936abc1..049154d64413 100644 --- a/pkgs/tools/networking/x11-ssh-askpass/default.nix +++ b/pkgs/tools/networking/x11-ssh-askpass/default.nix @@ -30,7 +30,5 @@ stdenv.mkDerivation rec { description = "Lightweight passphrase dialog for OpenSSH or other open variants of SSH"; license = licenses.mit; platforms = platforms.unix; - # never built on aarch64-darwin since first introduction in nixpkgs - broken = stdenv.isDarwin && stdenv.isAarch64; }; } diff --git a/pkgs/tools/security/rhash/default.nix b/pkgs/tools/security/rhash/default.nix index b539772213bb..4b4103ff9fb1 100644 --- a/pkgs/tools/security/rhash/default.nix +++ b/pkgs/tools/security/rhash/default.nix @@ -1,30 +1,21 @@ { lib , stdenv , fetchFromGitHub -, fetchpatch , which , enableStatic ? stdenv.hostPlatform.isStatic }: stdenv.mkDerivation rec { - version = "1.4.2"; + version = "1.4.3"; pname = "rhash"; src = fetchFromGitHub { owner = "rhash"; repo = "RHash"; rev = "v${version}"; - sha256 = "sha256-HkDgWwHoRWCNtWyfP4sj3veEd+KT5J7yL4J4Z/hJcrE="; + sha256 = "sha256-R+dHYG0DBI1uo+yF/pxoTv/V9WSfph043bH6erZjeCE="; }; - patches = [ - # Fix clang configuration; remove with next release - (fetchpatch { - url = "https://github.com/rhash/RHash/commit/4dc506066cf1727b021e6352535a8bb315c3f8dc.patch"; - sha256 = "0i5jz2s37h278c8d36pzphhp8rjy660zmhpg2cqlp960f6ny8wwj"; - }) - ]; - nativeBuildInputs = [ which ]; # configure script is not autotools-based, doesn't support these options diff --git a/pkgs/tools/security/tcb/default.nix b/pkgs/tools/security/tcb/default.nix index 63b252be9521..b49f7767dcbd 100644 --- a/pkgs/tools/security/tcb/default.nix +++ b/pkgs/tools/security/tcb/default.nix @@ -26,6 +26,9 @@ stdenv.mkDerivation rec { --replace "PREFIX = /usr" "PREFIX = $out" \ --replace "SBINDIR = /sbin" "SBINDIR = $bin/bin" \ --replace "INCLUDEDIR = \$(PREFIX)/include" "INCLUDEDIR = $dev/include" + + # Override default 'CC=gcc' + makeFlagsArray+=("CC=$CC") ''; meta = with lib; { diff --git a/pkgs/tools/system/pciutils/default.nix b/pkgs/tools/system/pciutils/default.nix index 66bcde737146..9b0b09066438 100644 --- a/pkgs/tools/system/pciutils/default.nix +++ b/pkgs/tools/system/pciutils/default.nix @@ -2,15 +2,16 @@ , hwdata , static ? stdenv.hostPlatform.isStatic , IOKit +, gitUpdater }: stdenv.mkDerivation rec { pname = "pciutils"; - version = "3.8.0"; # with release-date database + version = "3.9.0"; # with release-date database src = fetchurl { url = "mirror://kernel/software/utils/pciutils/pciutils-${version}.tar.xz"; - sha256 = "sha256-ke29BCmoRwXJrRVtT/OMzHJNQepUxMW4jjjplvijTwU="; + sha256 = "sha256-zep66XI53uIySaCcaKGaKHo/EJ++ssIy67YWyzhZkBI="; }; nativeBuildInputs = [ pkg-config ]; @@ -43,6 +44,12 @@ stdenv.mkDerivation rec { cp --reflink=auto ${hwdata}/share/hwdata/pci.ids $out/share/pci.ids ''; + passthru.updateScript = gitUpdater { + # No nicer place to find latest release. + url = "https://github.com/pciutils/pciutils.git"; + rev-prefix = "v"; + }; + meta = with lib; { homepage = "https://mj.ucw.cz/sw/pciutils/"; description = "A collection of programs for inspecting and manipulating configuration of PCI devices"; diff --git a/pkgs/tools/system/rocm-smi/default.nix b/pkgs/tools/system/rocm-smi/default.nix index 33bda1e56455..6b67ef13128b 100644 --- a/pkgs/tools/system/rocm-smi/default.nix +++ b/pkgs/tools/system/rocm-smi/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocm-smi"; - version = "5.4.0"; + version = "5.4.1"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; @@ -37,5 +37,6 @@ stdenv.mkDerivation (finalAttrs: { license = with licenses; [ mit ]; maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; platforms = [ "x86_64-linux" ]; + broken = finalAttrs.version != stdenv.cc.version; }; }) diff --git a/pkgs/tools/text/gawk/darwin-no-pma.patch b/pkgs/tools/text/gawk/darwin-no-pma.patch new file mode 100644 index 000000000000..f198acd41af1 --- /dev/null +++ b/pkgs/tools/text/gawk/darwin-no-pma.patch @@ -0,0 +1,31 @@ +https://git.savannah.gnu.org/cgit/gawk.git/patch/?id=e0b7737930f8a677d3c509f8ce72b9130965ec0a +--- a/m4/pma.m4 ++++ b/m4/pma.m4 +@@ -23,15 +23,18 @@ then + [LDFLAGS="${LDFLAGS} -no-pie" + export LDFLAGS]) + ;; +- *darwin*) +- # 23 October 2022: See README_d/README.macosx for +- # the details on what's happening here. See also +- # the manual. +- +- # Compile as Intel binary all the time, even on M1. +- CFLAGS="${CFLAGS} -arch x86_64" +- LDFLAGS="${LDFLAGS} -Xlinker -no_pie" +- export CFLAGS LDFLAGS ++ *darwin*) ++ # 27 November 2022: PMA only works on Intel. ++ case $host in ++ x86_64-*) ++ LDFLAGS="${LDFLAGS} -Xlinker -no_pie" ++ export LDFLAGS ++ ;; ++ *) ++ # disable on all other macOS systems ++ use_persistent_malloc=no ++ ;; ++ esac + ;; + *cygwin* | *CYGWIN* | *solaris2.11* | freebsd13.* | openbsd7.* ) + true # nothing do, exes on these systems are not PIE diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix index 3f91a301fd1b..f07da96aa48b 100644 --- a/pkgs/tools/text/gawk/default.nix +++ b/pkgs/tools/text/gawk/default.nix @@ -2,6 +2,7 @@ # TODO: links -lsigsegv but loses the reference for some reason , withSigsegv ? (false && stdenv.hostPlatform.system != "x86_64-cygwin"), libsigsegv , interactive ? false, readline +, autoreconfHook # no-pma fix /* Test suite broke on: stdenv.isCygwin # XXX: `test-dup2' segfaults on Cygwin 6.1 @@ -17,18 +18,26 @@ assert (doCheck && stdenv.isLinux) -> glibcLocales != null; stdenv.mkDerivation rec { pname = "gawk" + lib.optionalString interactive "-interactive"; - version = "5.1.1"; + version = "5.2.1"; src = fetchurl { url = "mirror://gnu/gawk/gawk-${version}.tar.xz"; - sha256 = "18kybw47fb1sdagav7aj95r9pp09r5gm202y3ahvwjw9dqw2jxnq"; + hash = "sha256-ZzVTuR+eGMxXku1RB1341RDJBA9VCm904Jya3SQ6fk8="; }; + patches = [ + # Pull upstream fix for aarch64-darwin where pma does not work. + # Can be removed after next gawk release. + ./darwin-no-pma.patch + ]; + # When we do build separate interactive version, it makes sense to always include man. outputs = [ "out" "info" ] ++ lib.optional (!interactive) "man"; - nativeBuildInputs = lib.optional (doCheck && stdenv.isLinux) glibcLocales; + nativeBuildInputs = lib.optional (doCheck && stdenv.isLinux) glibcLocales + # no-pma fix + ++ [ autoreconfHook ]; buildInputs = lib.optional withSigsegv libsigsegv ++ lib.optional interactive readline diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix index 32f6f30cb1ac..f493e4f358d6 100644 --- a/pkgs/tools/text/gnused/default.nix +++ b/pkgs/tools/text/gnused/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "gnused"; - version = "4.8"; + version = "4.9"; src = fetchurl { url = "mirror://gnu/sed/sed-${version}.tar.xz"; - sha256 = "0cznxw73fzv1n3nj2zsq6nf73rvsbxndp444xkpahdqvlzz0r6zp"; + sha256 = "sha256-biJrcy4c1zlGStaGK9Ghq6QteYKSLaelNRljHSSXUYE="; }; outputs = [ "out" "info" ]; diff --git a/pkgs/tools/text/mdbook/default.nix b/pkgs/tools/text/mdbook/default.nix index 96b0f3dbfcf8..d3bf8b2d8bf4 100644 --- a/pkgs/tools/text/mdbook/default.nix +++ b/pkgs/tools/text/mdbook/default.nix @@ -13,6 +13,8 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-6UiE/b6iJkuM/9g5yhB33WwTZ2VYlWFWQdfdHzA39CM="; + auditable = true; # TODO: remove when this is the default + buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ]; passthru = { diff --git a/pkgs/tools/text/ripgrep/default.nix b/pkgs/tools/text/ripgrep/default.nix index 022f8bd25bb7..be989994dbff 100644 --- a/pkgs/tools/text/ripgrep/default.nix +++ b/pkgs/tools/text/ripgrep/default.nix @@ -22,6 +22,8 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "1kfdgh8dra4jxgcdb0lln5wwrimz0dpp33bq3h7jgs8ngaq2a9wp"; + auditable = true; # TODO: remove when this is the default + nativeBuildInputs = [ asciidoctor installShellFiles ] ++ lib.optional withPCRE2 pkg-config; buildInputs = lib.optional withPCRE2 pcre2 diff --git a/pkgs/tools/typesetting/lout/builder.sh b/pkgs/tools/typesetting/lout/builder.sh index eab37c3c68fb..cd513337f6f3 100755 --- a/pkgs/tools/typesetting/lout/builder.sh +++ b/pkgs/tools/typesetting/lout/builder.sh @@ -1,6 +1,7 @@ # Prepare a makefile specifying the appropriate output directories. # # Written by Ludovic Courtès . +if [ -e .attrs.sh ]; then source .attrs.sh; fi source "$stdenv/setup" || exit 1 diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index e9fc7826f8d3..baf6fcc6873b 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -238,7 +238,7 @@ core-big = stdenv.mkDerivation { #TODO: upmendex "xetex" ]; postInstall = '' - for output in $outputs; do + for output in $(getAllOutputNames); do mkdir -p "''${!output}/bin" done diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index 71902a194ac5..e7aaac3c8de6 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -3,7 +3,7 @@ - current html: https://nixos.org/nixpkgs/manual/#sec-language-texlive */ { stdenv, lib, fetchurl, runCommand, writeText, buildEnv -, callPackage, ghostscriptX, harfbuzz +, callPackage, ghostscript_headless, harfbuzz , makeWrapper, python3, ruby, perl, gnused, gnugrep, coreutils , libfaketime , useFixedHashes ? true @@ -12,7 +12,7 @@ let # various binaries (compiled) bin = callPackage ./bin.nix { - ghostscript = ghostscriptX; + ghostscript = ghostscript_headless; harfbuzz = harfbuzz.override { withIcu = true; withGraphite2 = true; }; @@ -25,7 +25,7 @@ let combine = import ./combine.nix { inherit bin combinePkgs buildEnv lib makeWrapper writeText stdenv python3 ruby perl gnused gnugrep coreutils libfaketime; - ghostscript = ghostscriptX; # could be without X, probably, but we use X above + ghostscript = ghostscript_headless; }; # the set of TeX Live packages, collections, and schemes; using upstream naming diff --git a/pkgs/tools/video/rav1e/default.nix b/pkgs/tools/video/rav1e/default.nix index 8a2d6f744422..f75c38111a57 100644 --- a/pkgs/tools/video/rav1e/default.nix +++ b/pkgs/tools/video/rav1e/default.nix @@ -22,6 +22,8 @@ in rustPlatform.buildRustPackage rec { cargoHash = "sha256-iHOmItooNsGq6iTIb9M5IPXMwYh2nQ03qfjomkgCdgw="; + auditable = true; # TODO: remove when this is the default + nativeBuildInputs = [ nasm cargo-c ]; buildInputs = lib.optionals stdenv.isDarwin [ diff --git a/pkgs/tools/virtualization/awsebcli/default.nix b/pkgs/tools/virtualization/awsebcli/default.nix index e9c4a6e40ebb..df6e76d63b8b 100644 --- a/pkgs/tools/virtualization/awsebcli/default.nix +++ b/pkgs/tools/virtualization/awsebcli/default.nix @@ -49,7 +49,7 @@ with localPython.pkgs; buildPythonApplication rec { substituteInPlace setup.py \ --replace "six>=1.11.0,<1.15.0" "six==1.16.0" \ --replace "requests>=2.20.1,<=2.26" "requests==2.28.1" \ - --replace "botocore>1.23.41,<1.24.0" "botocore>1.23.41,<1.27.76" \ + --replace "botocore>1.23.41,<1.24.0" "botocore>1.23.41,<2" \ --replace "pathspec==0.9.0" "pathspec>=0.10.0,<0.11.0" \ --replace "colorama>=0.2.5,<0.4.4" "colorama>=0.2.5,<=0.4.6" \ --replace "termcolor == 1.1.0" "termcolor>=2.0.0,<2.1.0" diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 7041d012f4b2..aba3ad716ab2 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1631,6 +1631,7 @@ mapAliases ({ xfceUnstable = throw "xfceUnstable has been removed, use xfce instead"; # added 2022-12-25 xineLib = xine-lib; # Added 2021-04-27 xineUI = xine-ui; # Added 2021-04-27 + xlibsWrapper = throw "'xlibsWrapper' has been replaced by its constituents"; # Converted to throw 2022-12-27 xmonad_log_applet_gnome3 = throw "'xmonad_log_applet_gnome3' has been renamed to/replaced by 'xmonad_log_applet'"; # Converted to throw 2022-02-22 xmpp-client = throw "xmpp-client has been dropped due to the lack of maintanence from upstream since 2017"; # Added 2022-06-02 xmpppy = throw "xmpppy has been removed from nixpkgs as it is unmaintained and python2-only"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9df56d2890b7..e4dc26675b41 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1914,9 +1914,7 @@ with pkgs; thicket = callPackage ../applications/version-management/thicket { }; - tig = callPackage ../applications/version-management/tig { - readline = readline81; - }; + tig = callPackage ../applications/version-management/tig { }; top-git = callPackage ../applications/version-management/topgit { }; @@ -13588,16 +13586,16 @@ with pkgs; any-nix-shell = callPackage ../shells/any-nix-shell { }; - bash = lowPrio (callPackage ../shells/bash/5.1.nix { + bash = lowPrio (callPackage ../shells/bash/5.nix { binutils = stdenv.cc.bintools; }); # WARNING: this attribute is used by nix-shell so it shouldn't be removed/renamed - bashInteractive = callPackage ../shells/bash/5.1.nix { + bashInteractive = callPackage ../shells/bash/5.nix { binutils = stdenv.cc.bintools; interactive = true; withDocs = true; }; - bashInteractiveFHS = callPackage ../shells/bash/5.1.nix { + bashInteractiveFHS = callPackage ../shells/bash/5.nix { binutils = stdenv.cc.bintools; interactive = true; withDocs = true; @@ -13921,6 +13919,7 @@ with pkgs; clangStdenv = if stdenv.cc.isClang then stdenv else lowPrio llvmPackages.stdenv; clang-sierraHack-stdenv = overrideCC stdenv buildPackages.clang-sierraHack; libcxxStdenv = if stdenv.isDarwin then stdenv else lowPrio llvmPackages.libcxxStdenv; + rocmClangStdenv = llvmPackages_rocm.rocmClangStdenv; clasp-common-lisp = callPackage ../development/compilers/clasp { llvmPackages = llvmPackages_6; @@ -14064,9 +14063,11 @@ with pkgs; wrapNonDeterministicGcc = stdenv: ccWrapper: if ccWrapper.isGNU then ccWrapper.overrideAttrs(old: { - cc = old.cc.override { - reproducibleBuild = false; - profiledCompiler = with stdenv; (!isDarwin && hostPlatform.isx86); + env = old.env // { + cc = old.env.cc.override { + reproducibleBuild = false; + profiledCompiler = with stdenv; (!isDarwin && hostPlatform.isx86); + }; }; }) else ccWrapper; @@ -15209,83 +15210,157 @@ with pkgs; rml = callPackage ../development/compilers/rml { }; composable_kernel = callPackage ../development/libraries/composable_kernel { - inherit (llvmPackages) openmp; + inherit (llvmPackages_rocm) openmp clang-tools-extra; + stdenv = rocmClangStdenv; + }; + + rocprofiler = callPackage ../development/libraries/rocprofiler { + stdenv = rocmClangStdenv; }; clang-ocl = callPackage ../development/libraries/clang-ocl { - inherit (llvmPackages_rocm) clang; + stdenv = rocmClangStdenv; }; rgxg = callPackage ../tools/text/rgxg { }; - rocclr = callPackage ../development/libraries/rocclr { }; - - hip = callPackage ../development/compilers/hip { - inherit (llvmPackages_rocm) clang llvm; + rocclr = callPackage ../development/libraries/rocclr { + stdenv = rocmClangStdenv; }; - hipcub = callPackage ../development/libraries/hipcub { }; + hip-common = callPackage ../development/compilers/hip-common { + inherit (llvmPackages_rocm) llvm; + stdenv = rocmClangStdenv; + }; - hipsparse = callPackage ../development/libraries/hipsparse { }; + hipcc = callPackage ../development/compilers/hipcc { + inherit (llvmPackages_rocm) llvm; + stdenv = rocmClangStdenv; + }; - rccl = callPackage ../development/libraries/rccl { }; + hip = callPackage ../development/compilers/hip { + inherit (llvmPackages_rocm) llvm; + inherit (cudaPackages) cudatoolkit; + stdenv = rocmClangStdenv; + }; - rocm-cmake = callPackage ../development/tools/build-managers/rocm-cmake { }; + hip-amd = hip.override { + useNVIDIA = false; + }; + + hip-nvidia = hip.override { + useNVIDIA = true; + }; + + hipcub = callPackage ../development/libraries/hipcub { + stdenv = rocmClangStdenv; + }; + + hipsparse = callPackage ../development/libraries/hipsparse { + inherit (llvmPackages_rocm) openmp; + stdenv = rocmClangStdenv; + }; + + rccl = callPackage ../development/libraries/rccl { + stdenv = rocmClangStdenv; + }; + + rocm-cmake = callPackage ../development/tools/build-managers/rocm-cmake { + stdenv = rocmClangStdenv; + }; rocm-comgr = callPackage ../development/libraries/rocm-comgr { - inherit (llvmPackages_rocm) clang llvm; + stdenv = rocmClangStdenv; + }; + + rocalution = callPackage ../development/libraries/rocalution { + inherit (llvmPackages_rocm) openmp; + stdenv = rocmClangStdenv; }; rocm-device-libs = callPackage ../development/libraries/rocm-device-libs { - inherit (llvmPackages_rocm) clang llvm; + stdenv = rocmClangStdenv; }; - rocm-opencl-icd = callPackage ../development/libraries/rocm-opencl-icd { }; + rocm-opencl-icd = callPackage ../development/libraries/rocm-opencl-icd { + stdenv = rocmClangStdenv; + }; + + rocsolver = callPackage ../development/libraries/rocsolver { + stdenv = rocmClangStdenv; + }; rocm-opencl-runtime = callPackage ../development/libraries/rocm-opencl-runtime { - inherit (llvmPackages_rocm) clang llvm; + stdenv = rocmClangStdenv; }; rocm-runtime = callPackage ../development/libraries/rocm-runtime { - inherit (llvmPackages_rocm) llvm; + stdenv = rocmClangStdenv; }; - rocm-smi = python3Packages.callPackage ../tools/system/rocm-smi { }; + rocm-smi = python3Packages.callPackage ../tools/system/rocm-smi { + stdenv = rocmClangStdenv; + }; - rocm-thunk = callPackage ../development/libraries/rocm-thunk { }; + rocm-thunk = callPackage ../development/libraries/rocm-thunk { + stdenv = rocmClangStdenv; + }; - rocminfo = callPackage ../development/tools/rocminfo { }; + rocminfo = callPackage ../development/tools/rocminfo { + stdenv = rocmClangStdenv; + }; rocmlir = callPackage ../development/libraries/rocmlir { - inherit (llvmPackages_rocm) clang; + stdenv = rocmClangStdenv; }; - rocprim = callPackage ../development/libraries/rocprim { }; + rocmlir-rock = rocmlir.override { + buildRockCompiler = true; + }; - rocsparse = callPackage ../development/libraries/rocsparse { }; + rocprim = callPackage ../development/libraries/rocprim { + stdenv = rocmClangStdenv; + }; - rocfft = callPackage ../development/libraries/rocfft { }; + rocsparse = callPackage ../development/libraries/rocsparse { + stdenv = rocmClangStdenv; + }; - rocrand = callPackage ../development/libraries/rocrand { }; + rocfft = callPackage ../development/libraries/rocfft { + inherit (llvmPackages_rocm) openmp; + stdenv = rocmClangStdenv; + }; - tensile = python3Packages.callPackage ../development/libraries/tensile { }; + rocrand = callPackage ../development/libraries/rocrand { + stdenv = rocmClangStdenv; + }; + + tensile = python3Packages.callPackage ../development/libraries/tensile { + stdenv = rocmClangStdenv; + }; rocwmma = callPackage ../development/libraries/rocwmma { - inherit (llvmPackages) openmp; + inherit (llvmPackages_rocm) openmp; + stdenv = rocmClangStdenv; }; rocblas = callPackage ../development/libraries/rocblas { - inherit (llvmPackages_rocm) llvm; + inherit (llvmPackages_rocm) openmp; + stdenv = rocmClangStdenv; }; miopengemm = callPackage ../development/libraries/miopengemm { - inherit (llvmPackages_rocm) clang; + stdenv = rocmClangStdenv; }; - rocthrust = callPackage ../development/libraries/rocthrust { }; + rocthrust = callPackage ../development/libraries/rocthrust { + stdenv = rocmClangStdenv; + }; miopen = callPackage ../development/libraries/miopen { - inherit (llvmPackages_rocm) clang llvm; + inherit (llvmPackages_rocm) llvm clang-tools-extra; + stdenv = rocmClangStdenv; + rocmlir = rocmlir-rock; boost = boost.override { enableStatic = true; }; }; @@ -15299,15 +15374,20 @@ with pkgs; rocmUpdateScript = callPackage ../development/rocm-modules/update-script { }; + # Requires GCC + roctracer = callPackage ../development/libraries/roctracer { + inherit (llvmPackages_rocm) clang; + }; + rtags = callPackage ../development/tools/rtags { inherit (darwin) apple_sdk; }; - rust_1_65 = callPackage ../development/compilers/rust/1_65.nix { + rust_1_66 = callPackage ../development/compilers/rust/1_66.nix { inherit (darwin.apple_sdk.frameworks) CoreFoundation Security SystemConfiguration; llvm_14 = llvmPackages_14.libllvm; }; - rust = rust_1_65; + rust = rust_1_66; mrustc = callPackage ../development/compilers/mrustc { }; mrustc-minicargo = callPackage ../development/compilers/mrustc/minicargo.nix { }; @@ -15316,8 +15396,8 @@ with pkgs; openssl = openssl_1_1; }; - rustPackages_1_65 = rust_1_65.packages.stable; - rustPackages = rustPackages_1_65; + rustPackages_1_66 = rust_1_66.packages.stable; + rustPackages = rustPackages_1_66; inherit (rustPackages) cargo clippy rustc rustPlatform; @@ -15350,6 +15430,7 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; cargo-auditable = callPackage ../development/tools/rust/cargo-auditable { }; + cargo-auditable-cargo-wrapper = callPackage ../development/tools/rust/cargo-auditable/cargo-wrapper.nix { }; cargo-bisect-rustc = callPackage ../development/tools/rust/cargo-bisect-rustc { inherit (darwin.apple_sdk.frameworks) Security; openssl = openssl_1_1; @@ -20304,9 +20385,7 @@ with pkgs; libargs = callPackage ../development/libraries/libargs { }; - libarchive = callPackage ../development/libraries/libarchive { - autoreconfHook = buildPackages.autoreconfHook269; - }; + libarchive = callPackage ../development/libraries/libarchive { }; libarchive-qt = libsForQt5.callPackage ../development/libraries/libarchive-qt { }; @@ -20439,7 +20518,9 @@ with pkgs; libcint = callPackage ../development/libraries/libcint { }; - libclc = callPackage ../development/libraries/libclc { }; + libclc = callPackage ../development/libraries/libclc { + llvmPackages = llvmPackages_latest; + }; libcli = callPackage ../development/libraries/libcli { }; @@ -20508,8 +20589,7 @@ with pkgs; }; libdevil-nox = libdevil.override { - libX11 = null; - libGL = null; + withXorg = false; }; libdecor = callPackage ../development/libraries/libdecor { }; @@ -22488,13 +22568,13 @@ with pkgs; raylib = callPackage ../development/libraries/raylib { }; - readline = readline81; + readline = readline82; readline63 = callPackage ../development/libraries/readline/6.3.nix { }; readline70 = callPackage ../development/libraries/readline/7.0.nix { }; - readline81 = callPackage ../development/libraries/readline/8.1.nix { }; + readline82 = callPackage ../development/libraries/readline/8.2.nix { }; readosm = callPackage ../development/libraries/readosm { }; @@ -23387,14 +23467,6 @@ with pkgs; xgeometry-select = callPackage ../tools/X11/xgeometry-select { }; - # Avoid using this. It isn't really a wrapper anymore, but we keep the name. - xlibsWrapper = callPackage ../development/libraries/xlibs-wrapper { - packages = [ - freetype fontconfig xorg.xorgproto xorg.libX11 xorg.libXt - xorg.libXft xorg.libXext xorg.libSM xorg.libICE - ]; - }; - xmlada = callPackage ../development/libraries/ada/xmlada { }; xmlrpc_c = callPackage ../development/libraries/xmlrpc-c { }; @@ -25283,9 +25355,7 @@ with pkgs; drbd = callPackage ../os-specific/linux/drbd { }; - dropwatch = callPackage ../os-specific/linux/dropwatch { - readline = readline81; - }; + dropwatch = callPackage ../os-specific/linux/dropwatch { }; dsd = callPackage ../applications/radio/dsd { }; @@ -26195,6 +26265,7 @@ with pkgs; withEfi = false; withFido2 = false; withHostnamed = false; + withHomed = false; withHwdb = false; withImportd = false; withLibBPF = false; @@ -36938,6 +37009,11 @@ with pkgs; x11Support = true; }; + ghostscript_headless = ghostscript.override { + cupsSupport = false; + x11Support = false; + }; + glava = callPackage ../applications/misc/glava {}; gnuk = callPackage ../misc/gnuk { diff --git a/pkgs/top-level/config.nix b/pkgs/top-level/config.nix index a47655f11424..1de93a9f3fde 100644 --- a/pkgs/top-level/config.nix +++ b/pkgs/top-level/config.nix @@ -47,6 +47,10 @@ let feature = "set `strictDeps` to true by default"; }; + structuredAttrsByDefault = mkMassRebuild { + feature = "set `__structuredAttrs` to true by default"; + }; + enableParallelBuildingByDefault = mkMassRebuild { feature = "set `enableParallelBuilding` to true by default"; }; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 624eacbd26f1..37c1b350b9cc 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -23029,7 +23029,7 @@ let # For some crazy reason Makefile.PL doesn't generate a Makefile if # AUTOMATED_TESTING is set. - AUTOMATED_TESTING = false; + env.AUTOMATED_TESTING = false; # Makefile.PL looks for ncurses in Glibc's prefix. preConfigure = @@ -27058,7 +27058,7 @@ let hash = "sha256-gxxY8549/ebS3QORjSs8IgdBs2aD05Tu+9Bn70gu7gQ="; }) ]; - AUTOMATED_TESTING = false; + env.AUTOMATED_TESTING = false; nativeBuildInputs = [ pkgs.pkg-config ]; buildInputs = [ pkgs.xorg.libxcb pkgs.xorg.xcbproto pkgs.xorg.xcbutil pkgs.xorg.xcbutilwm ExtUtilsDepends ExtUtilsPkgConfig TestDeep TestException XSObjectMagic ]; propagatedBuildInputs = [ DataDump MouseXNativeTraits XMLDescent XMLSimple ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b6aaa8a203bd..9726609c6673 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5634,6 +5634,7 @@ self: super: with self; { matplotlib = callPackage ../development/python-modules/matplotlib { stdenv = if stdenv.isDarwin then pkgs.clangStdenv else pkgs.stdenv; inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa; + ghostscript = pkgs.ghostscript_headless; }; matplotlib-inline = callPackage ../development/python-modules/matplotlib-inline { }; @@ -10614,7 +10615,9 @@ self: super: with self; { spinners = callPackage ../development/python-modules/spinners { }; - sphinx-automodapi = callPackage ../development/python-modules/sphinx-automodapi { }; + sphinx-automodapi = callPackage ../development/python-modules/sphinx-automodapi { + graphviz = pkgs.graphviz; + }; sphinx-better-theme = callPackage ../development/python-modules/sphinx-better-theme { }; @@ -10720,6 +10723,8 @@ self: super: with self; { sphinx-markdown-parser = callPackage ../development/python-modules/sphinx-markdown-parser { }; + sphinx-markdown-tables = callPackage ../development/python-modules/sphinx-markdown-tables { }; + sphinx-material = callPackage ../development/python-modules/sphinx-material { }; sphinx-navtree = callPackage ../development/python-modules/sphinx-navtree { }; @@ -11441,6 +11446,8 @@ self: super: with self; { troposphere = callPackage ../development/python-modules/troposphere { }; + trove-classifiers = callPackage ../development/python-modules/trove-classifiers { }; + trueskill = callPackage ../development/python-modules/trueskill { }; trustme = callPackage ../development/python-modules/trustme { }; diff --git a/pkgs/top-level/python2-packages.nix b/pkgs/top-level/python2-packages.nix index 00d28e73854f..83a90a2a5e6d 100644 --- a/pkgs/top-level/python2-packages.nix +++ b/pkgs/top-level/python2-packages.nix @@ -79,6 +79,10 @@ with self; with super; { typing = callPackage ../development/python2-modules/typing { }; + six = super.six.overridePythonAttrs (_: { + doCheck = false; # circular dependency with pytest + }); + zeek = disabled super.zeek; zipp = callPackage ../development/python2-modules/zipp { };